angular-auto-validate icon indicating copy to clipboard operation
angular-auto-validate copied to clipboard

Attribute "element-modifier" is not applied to element descendants

Open mgsstms opened this issue 10 years ago • 9 comments
trafficstars

Attribute "element-modifier" is not applied to element descendants for complex elements like timepicker (html table with inputs and button is generated here). The default modifier process these inputs and button.

mgsstms avatar Apr 06 '15 17:04 mgsstms

Have you added "register-custom-form-control" to your custom field? HTML elements are added to a HTML form controller, but custom elements are not. Angular auto validate uses the HTML form controller to decide what it should validate. Adding "register-custom-form-control" makes angular auto validate aware of your custom element.

Let me know if that works for you. :)

pjwalmsley avatar Apr 07 '15 15:04 pjwalmsley

Thank you, but it will not work for me (( The module validates timepicker(shows errors or success), that's why no need to use the "register-custom-form-control". In my case the problem is, that default bs3 element modifier adds "has-success has-feedback" style classes, which corrupts view (I still want to use default "has-success has-feedback" for other html elements like input, select etc). That's why I decided to create custom element modifier, where I removed only "has-success has-feedback" style classes in makeValid.

mgsstms avatar Apr 07 '15 16:04 mgsstms

Ok, so to clarify; The default element modifier corrupts the view. To get around that you have created a custom element modifier. You wish to apply this to only your timepicker with element-modifier, but that does not work (as in it does not register as the time modifier for that element)?

Personally never used it with a timepicker. I'll try to take a peek at it later tonight or tomorrow/tomorrow night.

pjwalmsley avatar Apr 07 '15 21:04 pjwalmsley

It must be something to do with the root element of the custom control @mgsstms could you do a reproducing plunker so I can debug it.

jonsamwell avatar Apr 10 '15 06:04 jonsamwell

I got the problem to reproduce this on plunker (shame on mr ((). I prepared the archive with 3 index files: https://www.dropbox.com/s/yvduzitcmem2mk5/_test.zip?dl=0

mgsstms avatar Apr 10 '15 12:04 mgsstms

Thanks for this!!! I'm on holiday until next Wednesday so I afraid I won't be able to look at it properly until then as I only have my tablet with me. Sorry for the inconvenience!

jonsamwell avatar Apr 10 '15 12:04 jonsamwell

Jon, thank you

mgsstms avatar Apr 10 '15 12:04 mgsstms

@mgsstms were you able to solve it?

cmayankc avatar Mar 09 '17 04:03 cmayankc

I updated template for timepicker template ('form-group' class has been removed for 'meridian' button)

mgsstms avatar Mar 09 '17 06:03 mgsstms