Skip to content

Commit 9ef2960

Browse files
committed
Fix selecting bookmark name or URL in properties dialog when focusing each input
1 parent d26eb9d commit 9ef2960

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
88
- Update Svelte Material UI to 6.1.4.
99
- Replace Rollup with Vite as the build tool.
1010

11+
### Fixed
12+
- Fix selecting bookmark name or URL in properties dialog when focusing each input.
13+
1114
## [1.4.1] - 2022-06-20
1215
### Fixed
1316
- Fix color scheme when legacy 'system' option is stored.

src/treetop/PropertiesDialog.svelte

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@
3131
3232
function handleTextFieldFocus(e: CustomEvent | FocusEvent) {
3333
e = e as FocusEvent;
34-
const inputElement = e.currentTarget as HTMLInputElement;
35-
inputElement.select();
34+
35+
// Select all text in the focused input element
36+
const labelElement = e.currentTarget as HTMLLabelElement;
37+
const inputElement = labelElement.control as HTMLInputElement;
38+
inputElement?.select();
3639
}
3740
3841
const maxHeaderTitleLength = 58;

0 commit comments

Comments
 (0)