Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Update editing state in InputConnectionAdaptor.setSelection - #17652

Merged
jason-simmons merged 1 commit into
flutter-team-archive:masterfrom
jason-simmons:input_number_update_state
Apr 12, 2020
Merged

jason-simmons merged 1 commit into
flutter-team-archive:masterfrom
jason-simmons:input_number_update_state

Conversation

@jason-simmons

Copy link
Copy Markdown
Contributor

The BaseInputConnection superclass does not call endBatchEdit
in setSelection and therefore does not implicitly cause
InputConnectionAdaptor to send a state update.

Some input modes such as numeric keypads will not function without
these updates.

@jason-simmons
jason-simmons requested a review from GaryQian April 11, 2020 03:41
@auto-assign
auto-assign Bot requested a review from cbracken April 11, 2020 03:42
public boolean setSelection(int start, int end) {
boolean result = super.setSelection(start, end);
markDirty();
updateEditingState();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The markDirty() should be called as well before the updateEditingState() to make sure it is not accidentally treated as a repeat call.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@GaryQian GaryQian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, mod above comment, thanks for catching this!

The BaseInputConnection superclass does not call endBatchEdit
in setSelection and therefore does not implicitly cause
InputConnectionAdaptor to send a state update.

Some input modes such as numeric keypads will not function without
these updates.
@jason-simmons
jason-simmons force-pushed the input_number_update_state branch from 11db00c to 467219b Compare April 11, 2020 23:24
@jason-simmons
jason-simmons merged commit beb8a7e into flutter-team-archive:master Apr 12, 2020
goderbauer pushed a commit to goderbauer/engine that referenced this pull request Apr 16, 2020
…team-archive#17652)

The BaseInputConnection superclass does not call endBatchEdit
in setSelection and therefore does not implicitly cause
InputConnectionAdaptor to send a state update.

Some input modes such as numeric keypads will not function without
these updates.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

3 participants