Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0953c69
fix: Skip updating selection range during composition
koji-1009 Jan 13, 2025
3e19c27
Apply suggestions from code review
koji-1009 Mar 21, 2025
347faf1
test: Add test case
koji-1009 Mar 21, 2025
043a852
Update engine/src/flutter/lib/web_ui/test/engine/text_editing_test.dart
koji-1009 Mar 21, 2025
984d3f5
test: Fix test case
koji-1009 Mar 21, 2025
bbd217b
Update engine/src/flutter/lib/web_ui/lib/src/engine/text_editing/text…
koji-1009 Apr 7, 2025
3886c3b
Apply suggestions from code review
koji-1009 Apr 14, 2025
3387efa
remove: sync main
koji-1009 Apr 15, 2025
cae5264
fix: Disable shift + arrow key on web platform
koji-1009 Apr 15, 2025
53d4f90
test: Add test cases
koji-1009 Apr 15, 2025
4a70b0a
refactor: sort
koji-1009 Apr 15, 2025
96041b1
test: Remove unsupported shortcuts test
koji-1009 Apr 15, 2025
0f1b383
Revert "test: Remove unsupported shortcuts test"
koji-1009 Apr 16, 2025
256b691
Revert "refactor: sort"
koji-1009 Apr 16, 2025
b4c0c91
Revert "test: Add test cases"
koji-1009 Apr 16, 2025
b8b83f6
Revert "fix: Disable shift + arrow key on web platform"
koji-1009 Apr 16, 2025
56576be
fix: Reflecting the composing process to Japanese text input
koji-1009 Apr 17, 2025
26a2640
test: Fix test case
koji-1009 Apr 18, 2025
85715ed
test: Add unit test
koji-1009 Apr 18, 2025
a5a8d7d
Revert "test: Add unit test"
koji-1009 Apr 22, 2025
317d1cf
test: Add unit test
koji-1009 Apr 23, 2025
abc3526
fix: Support partically selected style
koji-1009 Apr 28, 2025
1d37d47
test: Update unit test
koji-1009 Apr 28, 2025
1b23ee0
feat: Hold composingBase
koji-1009 May 16, 2025
ece4d52
test: Add unit test
koji-1009 May 16, 2025
fe51d20
fix: unit test
koji-1009 May 17, 2025
6d52b03
fix: Support home and end key
koji-1009 May 24, 2025
f060af9
refactor: Fix type and rename
koji-1009 May 30, 2025
d70db66
refactor: Remove line
koji-1009 May 31, 2025
d8b1720
Merge branch 'master' into fix/web_composing_range
koji-1009 May 31, 2025
1eb4915
chore: run test
koji-1009 May 31, 2025
cb6c360
Merge branch 'master' into fix/web_composing_range
koji-1009 Jun 1, 2025
8a48530
Merge branch 'master' into fix/web_composing_range
koji-1009 Jun 2, 2025
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
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Mouad Debbar <[email protected]>
  • Loading branch information
koji-1009 and mdebbar committed May 31, 2025
commit 3e19c278fa988beb6a5e41e9fd21b1e4f92d60d5
Original file line number Diff line number Diff line change
Expand Up @@ -973,19 +973,17 @@ class EditingState {
/// See also:
///
/// * [applyTextToDomElement], which is used for non-focused elements.
void applyToDomElement(DomHTMLElement? domElement, {bool isComposing = false}) {
void applyToDomElement(DomHTMLElement? domElement, {bool updateSelection = true}) {
if (domElement != null && domElement.isA<DomHTMLInputElement>()) {
final DomHTMLInputElement element = domElement as DomHTMLInputElement;
element.value = text;
if (!isComposing) {
// If the user is composing, we should not update the selection range.
if (updateSelection) {
element.setSelectionRange(minOffset, maxOffset);
}
} else if (domElement != null && domElement.isA<DomHTMLTextAreaElement>()) {
final DomHTMLTextAreaElement element = domElement as DomHTMLTextAreaElement;
element.value = text;
if (!isComposing) {
// If the user is composing, we should not update the selection range.
if (updateSelection) {
element.setSelectionRange(minOffset, maxOffset);
}
} else {
Expand Down Expand Up @@ -1164,7 +1162,7 @@ class GloballyPositionedTextEditingStrategy extends DefaultTextEditingStrategy {
// Set the last editing state if it exists, this is critical for a
// users ongoing work to continue uninterrupted when there is an update to
// the transform.
lastEditingState?.applyToDomElement(domElement, isComposing: isComposing);
lastEditingState?.applyToDomElement(domElement, updateSelection: !isComposing);
// On Chrome, when a form is focused, it opens an autofill menu
// immediately.
// Flutter framework sends `setEditableSizeAndTransform` for informing
Expand Down Expand Up @@ -1215,7 +1213,7 @@ class SafariDesktopTextEditingStrategy extends DefaultTextEditingStrategy {
// the transform.
// If domElement is not focused cursor location will not be correct.
moveFocusToActiveDomElement();
lastEditingState?.applyToDomElement(activeDomElement, isComposing: isComposing);
lastEditingState?.applyToDomElement(activeDomElement, updateSelection: !isComposing);
}
}

Expand Down Expand Up @@ -1473,7 +1471,7 @@ abstract class DefaultTextEditingStrategy
if (!isEnabled || !editingState!.isValid) {
return;
}
lastEditingState!.applyToDomElement(domElement, isComposing: isComposing);
lastEditingState!.applyToDomElement(domElement, updateSelection: !isComposing);
}

void placeElement() {
Expand Down Expand Up @@ -1994,7 +1992,7 @@ class FirefoxTextEditingStrategy extends GloballyPositionedTextEditingStrategy {
// Set the last editing state if it exists, this is critical for a
// users ongoing work to continue uninterrupted when there is an update to
// the transform.
lastEditingState?.applyToDomElement(activeDomElement, isComposing: isComposing);
lastEditingState?.applyToDomElement(activeDomElement, updateSelection: !isComposing);
}
}

Expand Down