fix(search-box-by-type): Fix clear button focus
What does this MR do?
Fixes the focus behavior of the "clear" button to not lose focus when clicked.
Previously, when nested inside a GlNewDropdown
, clicking the "clear" button would cause the dropdown to be closed. This was because the clear button - which owns the focus - was removed from the DOM on click, relinquishing the the focus to the window.
Now the button is simply hidden (display: none
), and the focus stays within the GlNewDropdown
, allowing it to stay open.
GIFs
Before | After |
---|---|