DanmarksAdresser / dawa-autocomplete2

https://dawadocs.dataforsyningen.dk
MIT License
17 stars 7 forks source link

IE11 input focus issue #8

Closed claudiuciumedean closed 5 years ago

claudiuciumedean commented 5 years ago

In IE11, if the container of the address suggestions has a maximum-height, making the container to have an overflow which can be visible by dragging the scroll bar, it is not possible to use the arrows on the scroll bar or drag the scroll bar.

I have investigated this problem and it is an IE11 related issue as the input is losing focus when trying to scroll in the container, thus the blur event is triggered and the suggestions are removed.

bug

andershessellund commented 5 years ago

Thanks for your bug report.

We never really intended for the autocomplete suggestions to support a scroll bar. I think would be a better solution to just display fewer suggestions, requiring the user to enter some more text instead.

If you have any suggestions for how the problem could be fixed, I will take a look at it. Otherwise, we will probably not prioritise the issue, as there is a workaround (not using the scroll bar) and it only affects a small and dwindling percentage of users, as the bug only affects IE11.

claudiuciumedean commented 5 years ago

I am working on fixing the bug right now, as soon as I am done with it, I will create a pull request and then you can investigate it.

claudiuciumedean commented 5 years ago

if(document.activeElement === inputElm.parentNode) { return; }

This if statement added in the blurHandler function actually solves the issue.

andershessellund commented 5 years ago

Thanks. I will take a look at it when we release the next version of the autocomplete component. This will probably be mid april.

claudiuciumedean commented 5 years ago

actually I have found a better fix for this issue, apparently the attribute: unselectable="on", placed on the suggestions container solves it.

andershessellund commented 5 years ago

Thanks for the fix. I have applied the unselectable="on" fix to master.