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 intoflutter:masterfrom
jason-simmons:input_number_update_state
Apr 12, 2020
Merged

Update editing state in InputConnectionAdaptor.setSelection#17652
jason-simmons merged 1 commit intoflutter:masterfrom
jason-simmons:input_number_update_state

Conversation

@jason-simmons
Copy link
Member

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
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
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@GaryQian GaryQian left a comment

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:master Apr 12, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 12, 2020
goderbauer pushed a commit to goderbauer/engine that referenced this pull request Apr 16, 2020
…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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants