ArthurClemens / polythene

Material Design component library for Mithril and React
590 stars 43 forks source link

Erroneous calls to onChange #80

Closed andershol closed 5 years ago

andershol commented 5 years ago

In some cases the onChange event handler for a TextField is called even if no change have occurred. For example loading this test case using the current "master" branch shows 6 calls to onChange by just loading the page and after focusing a text field and defocusing it again shows 11 calls, when no calls should occur in either case. Loading the same test case using the current "next" branch shows 0 calls to onChange after load (which is good), but after focusing a text field and defocusing it again it shows 10 calls, when again 0 was expected. (tested in Firefox and Chrome)

ArthurClemens commented 5 years ago

Note that focus is also passed in onChange, so it makes sense that a focus + a blur results in onChange calls. I will look into the others.

andershol commented 5 years ago

Okay, I had not noticed that. The it might just me my mistake, that I am using "onChanged: ev => ..." instead of "events: { oninput: ev => ... }". It would be nice to avoid the "events: { ... }" though. Thanks for pointing it out.