简体   繁体   中英

How to update template-driven form validation on Kendo UI for Angular ComboBox value change without blur event?

I'm working in a project with a template-driven form that contains a Kendo UI for Angular ComboBox component and a submit button. The ComboBox is required and allows custom input.

My current issue regards a requisite for the button disabled state to be updated as soon as the value changes. Currently the button disabled state is only updated when the component is blurred.

Looking at the ComboBoxComponent API I didn't find any feature to change this behavior.

I've created a Plunker that recreates part of my current implementation and this behavior.

I've came up with a kind of hack to be able to have this behavior.

I noticed that every change to the input would trigger the filter change event, so if I wanted for something to happen it would have to be there. I also found out that for the state of the form to be updated a blur event on the field would have to happen and also that I could call this event through the undocumented method blur in the ComboBoxComponent class.

See this Plunker with the described solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM