GNOME Bugzilla – Bug 725861
Search loses focus after filter is added
Last modified: 2014-03-15 18:02:31 UTC
When filtering the search, I expect to be able to select the filter, then start typing the search term. At the moment, the search field is not re-focused after a filter is selected.
Created attachment 271521 [details] [review] _searchEntry is refocused after a filter is selected
Review of attachment 271521 [details] [review]: Thanks for the patch, Rohit! This looks good to me, except for the following minor comment. ::: src/searchbar.js @@ +368,3 @@ + + if (eventDevice) + Gd.entry_focus_hack(this._searchEntry, eventDevice); Do you really need to check for a != null device before passing it down? I think the code is robust to a null device there.
(In reply to comment #2) > Review of attachment 271521 [details] [review]: > ::: src/searchbar.js > @@ +368,3 @@ > + > + if (eventDevice) > + Gd.entry_focus_hack(this._searchEntry, eventDevice); > > Do you really need to check for a != null device before passing it down? I > think the code is robust to a null device there. gd_entry_focus_hack does not look out for NULL devices. Passing a NULL device will lead to: fevent = gdk_event_new (GDK_FOCUS_CHANGE); gdk_event_set_device (fevent, NULL); And if we look higher up in the same file Searchbar.show has a similar chunk of code.
Review of attachment 271521 [details] [review]: Oops, you're right :-) Disregard that comment then - this looks good to me.
(In reply to comment #4) > Review of attachment 271521 [details] [review]: > > Oops, you're right :-) > Disregard that comment then - this looks good to me. Thanks for reviewing it. Can you please commit it for me ?
Review of attachment 271521 [details] [review]: ::: src/searchbar.js @@ +364,3 @@ this._searchEntry.add_tag(tag); } + Trailing whitespace alert!
Created attachment 272015 [details] [review] searchbar: Refocus the search entry after changing filters Committed it after removing the trailing whitespace and making sure that the commit message is not wider than 72 characters.
Thanks for the awesome patch, Rohit!
(In reply to comment #8) > Thanks for the awesome patch, Rohit! thanks :)