Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 5 additions & 1 deletion lib/web_ui/lib/src/engine/text_editing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ class TextEditingElement {
_subscriptions.add(domElement.onKeyUp.listen((event) {
_handleChange(event);
}));
/// In Firefox the context menu item "Select All" does not work without
/// listening onSelect. On the other browersers onSelectionChange is
Comment thread
nturgut marked this conversation as resolved.
Outdated
/// enough for covering "Select All" functionality.
_subscriptions.add(domElement.onSelect.listen(_handleChange));
Comment thread
nturgut marked this conversation as resolved.
} else {
_subscriptions.add(html.document.onSelectionChange.listen(_handleChange));
}
Expand Down Expand Up @@ -379,7 +383,7 @@ class TextEditingElement {
throw UnsupportedError(
'Unsupported input type: ${inputConfig.inputType}');
}
html.document.body.append(domElement);
domRenderer.glassPaneElement.append(domElement);
}

void _removeDomElement() {
Expand Down
4 changes: 4 additions & 0 deletions lib/web_ui/test/text_editing_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ void main() {
expect(document.activeElement, input);
expect(editingElement.domElement, input);

// Input is appended to the glass pane.
expect(domRenderer.glassPaneElement.contains(editingElement.domElement),
isTrue);

editingElement.disable();
expect(
document.getElementsByTagName('input'),
Expand Down