bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Dropdown: don't close menu on click inside input or textareas

Open derSascha opened this issue 3 years ago • 4 comments

Using dropdowns together with input fields as trigger works pretty well. After clicking into the input field, the drop down appears. Clicking a second time into the input field (e.g. to move the cursor) closes the dropdown menu. The second click works as expected on buttons but on input fields the feels confusing. The PR simply always calls show on input and textarea input fields and calls toggle on all other as before.

derSascha avatar Apr 08 '22 17:04 derSascha

Please you have to add a test to support your MR, and I would appreciate a live demo or video of the issue. Based on #36137 I cannot replicate the issue

GeoSot avatar Apr 08 '22 22:04 GeoSot

in any case this is invalid fix because input can be button too: <input type="button|submit|reset|image" ...> and no reasons to call show() for opened menu

WinterSilence avatar Apr 08 '22 22:04 WinterSilence

Created some demo snippet with an input field having a dropdown menu: https://jsfiddle.net/np4z7k80/ Clicking into the input field should open the dropdown, but clicking again into the input closes the dropdown.

What about some new configuration option or extending the auto close option?

@WinterSilence calling show() on an already visible dropdown has no effect and should be OK, but the <input type="button... thing is a problem that the current commit breaks.

derSascha avatar Apr 13 '22 13:04 derSascha

@GeoSot is this issue still exist? If yes i would like to work on this issue

abhimaurya-dev avatar Jan 09 '24 03:01 abhimaurya-dev