preact-mdl
preact-mdl copied to clipboard
Slider loses focus on change
Example without MDL: http://jsfiddle.net/fsebyLz2/ Example with MDL: http://jsfiddle.net/stx4n4y8/
Use your keyboard to focus on the slider. With MDL, the slider loses focus on every change.
I can't figure out what could be causing this...
Related to https://github.com/developit/preact/issues/54? Although I can only repro the problem on Chrome and Safari, but not Firefox...
I think this has something to do with component recycling. Working on a revamp of that right now.
@unindented Alright, it looks like this is because of another one of MDL's lovely "wrapper" divs. When we're upgrading the input element to an MDL slider, they actually rip it out of the DOM and inject a div around it, which is going to get overwritten every time preact tries to reconcile the VTree against the DOM. This can be fixed by creating the wrapper div in preact-mdl's Slider component. Might be a bit before I can PR a fix.
hate to dredge up an old thread, but this will be fixed here in order to fix compatibility with preact@beta, which no longer removes unknown elements by default.