Skip to content

Auto-select text in web editor input on focus#1708

Merged
phkahler merged 2 commits intomasterfrom
copilot/fix-highlight-text-input
Apr 1, 2026
Merged

Auto-select text in web editor input on focus#1708
phkahler merged 2 commits intomasterfrom
copilot/fix-highlight-text-input

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

On web, the dimension editor input box did not pre-select existing text when opened, requiring users to manually clear it before typing — unlike the desktop experience.

Change

Added select() call immediately after focus() in ShowEditor (guihtml.cpp) to highlight all text when the input is shown:

htmlEditor.set("value", text);
htmlEditor.call<void>("focus");
htmlEditor.call<void>("select");  // added

This invokes the browser-native HTMLInputElement.select(), selecting all text on open and matching desktop behavior.

Copilot AI linked an issue Apr 1, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix auto highlight text input on web version Auto-select text in web editor input on focus Apr 1, 2026
Copilot AI requested a review from phkahler April 1, 2026 17:14
@phkahler phkahler requested review from ruevs and removed request for ruevs April 1, 2026 17:26
@phkahler phkahler marked this pull request as ready for review April 1, 2026 20:42
@phkahler phkahler merged commit 07017fd into master Apr 1, 2026
8 checks passed
@ruevs
Copy link
Copy Markdown
Member

ruevs commented Apr 1, 2026

Yay! (?)
First successful LLM change!

BTW @phkahler did you try the GTK4 port? You've wanted it for years...

@ruevs ruevs deleted the copilot/fix-highlight-text-input branch April 1, 2026 20:47
@phkahler
Copy link
Copy Markdown
Member

phkahler commented Apr 3, 2026

BTW @phkahler did you try the GTK4 port? You've wanted it for years...

@ruevs No. My PC is still broken. BTW the GTK4 PR sitting here was prompted by someone I know. I also asked Claude to do the job about a month ago. I pasted guigtk into it, so it had no other context but our conversation. It then produced a full new version of the file. I pointed out that there were still some GTK3 calls in there so it went off again... I said menus were the biggest challenge because we create them imperatively rather than declaratively, so it need to do more work. It spit out another new version of the file. I haven't even tried to compile it yet. I have little confidence in either one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto highlight text input on web

3 participants