Don't show SystemContextMenu for SelectableText#169238
Don't show SystemContextMenu for SelectableText#169238auto-submit[bot] merged 4 commits intoflutter:masterfrom
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.
nit: should this change to iOS does not use the system context menu by default on SelectableText if supported
Renzo-Olivares
left a comment
There was a problem hiding this comment.
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
|
Dear flutter team - this is a perfect example for a plea to you: |
|
This landed in Flutter 3.35, at least according to the official changelog I had to manually search "flutter changelog 169238" to find out. |
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