-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Don't show SystemContextMenu for SelectableText #169238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't show SystemContextMenu for SelectableText #169238
Conversation
|
The test didn't catch it because I mistakenly wrote the test for TextField instead of SelectableText: https://github.com/flutter/flutter/pull/165354/files#diff-91845600bca2cea8a480c83f46dc8eb0b4880f0f2bf49668070ad16fe1c314d7R5587 |
| group('context menu', () { | ||
| // Regression test for https://github.com/flutter/flutter/issues/169001. | ||
| testWidgets( | ||
| 'iOS uses the system context menu by default if supported', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should this change to iOS does not use the system context menu by default on SelectableText if supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
Renzo-Olivares
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM w/ small nit.
|
@Renzo-Olivares @justinmc any chance this could be cherry picked into stable? |
When readOnly is true, there is no TextInputConnection, so the SystemContextMenu can't be shown. Instead, this shows the Flutter-drawn context menu. This video shows the change. You can slightly tell that the system context menu is shown when readOnly is false and the Flutter-drawn context menu is shown when it is true. https://github.com/user-attachments/assets/91480fa4-cce6-4d63-ae11-df72a229da73 This is the same root cause as #169238. Fixes #170521
|
Could someone tell me that on which flutter version this bug is fixed? Thanks! |
When readOnly is true, there is no TextInputConnection, so the SystemContextMenu can't be shown. Instead, this shows the Flutter-drawn context menu. This video shows the change. You can slightly tell that the system context menu is shown when readOnly is false and the Flutter-drawn context menu is shown when it is true. https://github.com/user-attachments/assets/91480fa4-cce6-4d63-ae11-df72a229da73 This is the same root cause as flutter#169238. Fixes flutter#170521
|
Is this released already? I just encountered this bug on flutter v3.32.7 |
|
I'm guessing this wasn't backported? Still seems busted in Flutter 3.32.8. |
When readOnly is true, there is no TextInputConnection, so the SystemContextMenu can't be shown. Instead, this shows the Flutter-drawn context menu. This video shows the change. You can slightly tell that the system context menu is shown when readOnly is false and the Flutter-drawn context menu is shown when it is true. https://github.com/user-attachments/assets/91480fa4-cce6-4d63-ae11-df72a229da73 This is the same root cause as flutter#169238. Fixes flutter#170521
|
Is the fix merged into a released flutter version? Thanks! |
|
on stable v3.35.2 this did not land yet |
When readOnly is true, there is no TextInputConnection, so the SystemContextMenu can't be shown. Instead, this shows the Flutter-drawn context menu. This video shows the change. You can slightly tell that the system context menu is shown when readOnly is false and the Flutter-drawn context menu is shown when it is true. https://github.com/user-attachments/assets/91480fa4-cce6-4d63-ae11-df72a229da73 This is the same root cause as flutter#169238. Fixes flutter#170521
When readOnly is true, there is no TextInputConnection, so the SystemContextMenu can't be shown. Instead, this shows the Flutter-drawn context menu. This video shows the change. You can slightly tell that the system context menu is shown when readOnly is false and the Flutter-drawn context menu is shown when it is true. https://github.com/user-attachments/assets/91480fa4-cce6-4d63-ae11-df72a229da73 This is the same root cause as flutter#169238. Fixes flutter#170521
Goes back to using the Flutter-drawn context menu for SelectableText. Currently, SystemContextMenu requires an active text input connection to work. This snuck in because SelectableText is based on EditableText.
Fixes #169001