After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 783632 - text is always selected on the from entry in routing sidebar
text is always selected on the from entry in routing sidebar
Status: RESOLVED FIXED
Product: gnome-maps
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-maps-maint
gnome-maps-maint
Depends on:
Blocks:
 
 
Reported: 2017-06-10 16:29 UTC by Andreas Nilsson
Modified: 2018-02-06 03:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screencast (1.71 MB, video/webm)
2017-06-10 16:29 UTC, Andreas Nilsson
  Details
sidebar: Remove focus from text in sidebar entry (1.10 KB, patch)
2018-01-24 10:28 UTC, Vibhanshu Vaibhav
none Details | Review
sidebar: Deselect text when focusing route entries (1.16 KB, patch)
2018-01-25 05:12 UTC, Vibhanshu Vaibhav
committed Details | Review

Description Andreas Nilsson 2017-06-10 16:29:03 UTC
Created attachment 353538 [details]
screencast

The from text always gets selected when auto-completing the address
Comment 1 Vibhanshu Vaibhav 2018-01-24 10:28:26 UTC
Created attachment 367364 [details] [review]
sidebar: Remove focus from text in sidebar entry

Instead of 'has_focus' property, grab_focus_without_selecting fucntion is used to remove focus from text.
Comment 2 Marcus Lundblad 2018-01-24 21:01:02 UTC
Review of attachment 367364 [details] [review]:

I think the commit subject is not quite correct here, rather than "Remove focus", I think it should mention not selecting the entry content, or something like that. Maybe "sidebar: Don't select text when focusing route entries".

::: src/sidebar.js
@@ +198,3 @@
 
+            this.connect('notify::child-revealed',
+                         routeEntry.entry.grab_focus_without_selecting.bind(routeEntry.entry));

This will actually trigger both when revealing and hiding the routing sidebar.
This has the effect that if the sidebar is revealed and then the user clicks on the search entry (for example) and then hides the sidebar (using the ctrl+d shortcut, not using the mouse as that would loose focus) then focus will shift over to the (now not visible) route from entry.
I think something like the following needs to be done:

this.connect('notify::child-revealed', (function() {
   if (this.child_revealed)
      routeEntry.entry.grab_focus_without_selecting();
}).bind(this));
Comment 3 Vibhanshu Vaibhav 2018-01-25 05:12:45 UTC
Created attachment 367410 [details] [review]
sidebar: Deselect text when focusing route entries

made the required changes
Comment 4 Marcus Lundblad 2018-02-05 13:04:06 UTC
Review of attachment 367410 [details] [review]:

::: src/sidebar.js
@@ +198,3 @@
 
+            this.connect('notify::child-revealed', (function(){
+                if(this.child_revealed)

Minor nitpick, should be a space before ( like:
if (condition..)
Comment 5 Marcus Lundblad 2018-02-05 21:00:35 UTC
Attachment 367410 [details] pushed as 8e02777 - sidebar: Deselect text when focusing route entries
Comment 6 Marcus Lundblad 2018-02-05 21:31:52 UTC
(In reply to Marcus Lundblad from comment #4)
> Review of attachment 367410 [details] [review] [review]:
> 
> ::: src/sidebar.js
> @@ +198,3 @@
>  
> +            this.connect('notify::child-revealed', (function(){
> +                if(this.child_revealed)
> 
> Minor nitpick, should be a space before ( like:
> if (condition..)

I pushed this with the formatting fix, so that it made it into the 3.27.90 release :) Thanks for patch!
Comment 7 Vibhanshu Vaibhav 2018-02-06 03:18:48 UTC
(In reply to Marcus Lundblad from comment #6)
> (In reply to Marcus Lundblad from comment #4)
> > Review of attachment 367410 [details] [review] [review] [review]:
> > 
> > ::: src/sidebar.js
> > @@ +198,3 @@
> >  
> > +            this.connect('notify::child-revealed', (function(){
> > +                if(this.child_revealed)
> > 
> > Minor nitpick, should be a space before ( like:
> > if (condition..)
> 
> I pushed this with the formatting fix, so that it made it into the 3.27.90
> release :) Thanks for patch!

Thanks a lot for guiding me to solve this one. :)