Open dp-sgr opened 1 year ago
Hi, I would like to work on this issue
/cc @GeoSot @patrickhlauke
i'd be conceptually ok with this (provided that an author who suppresses the automatic focus handling definitely implements their own focus handling, which is something we can reinforce in the docs)
Prerequisites
Proposal
Add an options object or similar to the show() method of an dropdown instance. Via the options we could simply configure if the show method should focus the toggler of the dropdown or not.
Something like that would be very nice:
As a possible workaround i currently implemented this hack:
Motivation and context
In some scenarious we don't want the toggler to be focused on dropdown show. In our specific use-case we have a custom autocomplete component which simply is a input-group of an text input and the dropdown toggler button.
By inserting chars to the text input (with a specific debounce time) the dropdown should be showed. But this currently leads to the issue of focusing the toggler.
https://github.com/twbs/bootstrap/blob/c735b2e196544b3bba25d645f4d725e8667b106c/js/src/dropdown.js#L151