ui icon indicating copy to clipboard operation
ui copied to clipboard

Click on magnifying glass in search should focus search field

Open bedengler opened this issue 1 year ago • 5 comments

I have now watched multiple times users using my application when they wanted to show me something.

When they want to search something (e.g. in a grid), they intuitively click on the magnifying glass icon in the search bar first. That doesn't work, so they click into the search field itself. That's almost always 2 clicks.

I suggest therefore adding an event to the magnifying glass that focuses the cursor into the search field when clicking on it.

bedengler avatar Feb 13 '24 02:02 bedengler

please describe repro steps on any https://ui.atk4.org/demos/ demo

mvorisek avatar Feb 13 '24 07:02 mvorisek

Go to https://ui.agiletoolkit.org/demos/collection/grid.php and click on the magnifying glass of the search field. Nothing happens. Click into the search field itself and the cursor jumps into the field and you can start typing.

Expected outcome: when you click on the magnifying glass, the cursor should jump into the search field and you can start typing.

bedengler avatar Feb 13 '24 08:02 bedengler

PR welcomed.

https://ui.agiletoolkit.org/demos/form-control/input.php page/demo might be useful as some inputs there have this working.

mvorisek avatar Feb 13 '24 09:02 mvorisek

@bedengler Generally agree, but the magnifying glass today has the function of starting the search already if the search field is not empty. This should be kept as functionality. And I see users doing this instead of pressing enter. We should in case of an improved PR make sure both functionalities are implemented: 1) For empty field setFocus to search field on click 2) For non-empty field, commit form and start search (as today).

mkrecek234 avatar Feb 14 '24 08:02 mkrecek234

Good point. And fully agree. Should we also take into consideration, if $hasAutoQuery is true or false then? And keep the functionality of focussing when clicking the magnifying glass if $hasAutoQuery == true?

bedengler avatar Feb 15 '24 06:02 bedengler