aFarkas / webshim

[DEPRECATED] Webshims Lib is a modular capability-based polyfill-loading library
http://aFarkas.github.com/webshim/demos/index.html
MIT License
1.42k stars 201 forks source link

Inputs do not appear to mirror class changes in original element #551

Closed jjoekoullas closed 8 years ago

jjoekoullas commented 9 years ago

Plunker here: http://plnkr.co/edit/xAwa39CIBF8jj9uDNJ9U?p=preview

I noticed this when using input[type="date"] in firefox along with ng-class from angular. It appears the element inserted by webshims does not mirror class changes in the original element (or possibly does not copy all attributes into new element).

aFarkas commented 9 years ago

No it doesn't this is by design: http://afarkas.github.io/webshim/demos/index.html#Guide-dom-abstractions

no shadowdom: Webshims lib sometimes has to add additional DOM elements to mimic the UI of HTML5 elements. This can sometimes create differences, between polyfilled and non polyfilled browsers. Webshims lib gives you a method called 'getShadowElement' to access the shadowelement from the native element and a method called 'getNativeElement' to access the native element from the shadowelement. If the element has no shadowelement the element itself is returned.

$('input[type="date"]').getShadowElement();

You can write a mutationobserver for your self if you need to.

jjoekoullas commented 9 years ago

Thank you for a quick response and good advice! :+1: