Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 21 additions & 49 deletions api/src/client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/src/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"global-jsdom": "^29.0.0",
"html-webpack-plugin": "^5.6.7",
"jsdom": "^29.1.1",
"jsf.js_next_gen": "4.1.0-beta.19",
"jsf.js_next_gen": "4.1.0-beta.20",
"mocha": "^11.7.6",
"nise": "^6.1.5",
"npm-check-updates": "^22.2.3",
Expand Down
14 changes: 12 additions & 2 deletions api/src/client/typescript/mona_dish/DomQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1937,8 +1937,18 @@ export class DomQuery implements IDomQuery, IStreamDataSource<DomQuery>, Iterabl
static setCaretPosition(ctrl: any, pos: number) {
ctrl?.focus ? ctrl?.focus() : null;
// the selection range is our caret position

ctrl?.setSelectionRange ? ctrl?.setSelectionRange(pos, pos) : null;
//
// setSelectionRange exists on every HTMLInputElement, but the DOM spec
// mandates that calling it on input types which do not support text
// selection (checkbox, radio, button, file, ...) throws an
// InvalidStateError. Hence a plain existence check is not enough; we
// additionally swallow the error so the focus above still takes effect
// (silent fail as documented).
try {
ctrl?.setSelectionRange ? ctrl?.setSelectionRange(pos, pos) : null;
} catch (e) {
// input type does not support a caret/selection -> nothing to set
}
}

/**
Expand Down
Loading