Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Highlight all text on watch expression edit#5226

Merged
wldcordeiro merged 3 commits into
firefox-devtools:masterfrom
AnshulMalik:watch-expressions-cursor
Jan 29, 2018
Merged

Highlight all text on watch expression edit#5226
wldcordeiro merged 3 commits into
firefox-devtools:masterfrom
AnshulMalik:watch-expressions-cursor

Conversation

@AnshulMalik
Copy link
Copy Markdown
Contributor

Associated Issue: #5220

Screenshots/Videos (OPTIONAL)

watch

@jasonLaster
Copy link
Copy Markdown
Contributor

looks great. It would be nice to have a comment on what the code is trying to do :)

@AnshulMalik
Copy link
Copy Markdown
Contributor Author

Hehe, I thought we hate comments :P

@jasonLaster
Copy link
Copy Markdown
Contributor

this is the exception to the rule lol

@jasonLaster
Copy link
Copy Markdown
Contributor

do we need to touch SearchInput?

@jasonLaster
Copy link
Copy Markdown
Contributor

CC @Loirooriol

@AnshulMalik
Copy link
Copy Markdown
Contributor Author

It's already a one-time thing in SearchInput because it's in componentDidMount. So we are good without this change.

@AnshulMalik
Copy link
Copy Markdown
Contributor Author

We should probably make this a helper function, moveCursorToEnd

@Loirooriol
Copy link
Copy Markdown
Contributor

Moving the cursor to the end when edition starts also seems a bit arbitrary. Selecting all the text may be more useful, this way you can just start typing and replace the old expression with the new one.

@jasonLaster
Copy link
Copy Markdown
Contributor

I think given that we're double clicking to edit the user would expect the text to be highlighted.

@AnshulMalik
Copy link
Copy Markdown
Contributor Author

watch

@jasonLaster
Copy link
Copy Markdown
Contributor

🔥

@AnshulMalik AnshulMalik changed the title Put the cursor at end only once on watch expression edit Highlight all text on watch expression edit Jan 29, 2018
@wldcordeiro wldcordeiro merged commit 3b97db8 into firefox-devtools:master Jan 29, 2018
@AnshulMalik AnshulMalik deleted the watch-expressions-cursor branch January 29, 2018 05:05
jasonLaster pushed a commit that referenced this pull request Jan 29, 2018
* Put the cursor at end only once on watch expression edit

* comment to understand whats going on

* highlight text on edit watch expression
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants