Skip to content

Conversation

@bleroux
Copy link
Contributor

@bleroux bleroux commented Feb 29, 2024

Description

This PR expands the items displayed in the overflow menu of a TextSelectionToolbar making buttons clickable in the blank area.

Before After
Each item has its own width All items expand horizontally
Capture d’écran 2024-02-29 à 14 43 57 Capture d’écran 2024-02-29 à 14 40 47

Related Issue

Fixes #144089.

Tests

Adds 1 tests.

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Feb 29, 2024
@bleroux bleroux force-pushed the fix_text_selection_toolbar_buttons_width_in_overflow_menu branch from e336bfb to 92afdf0 Compare February 29, 2024 14:47
@bleroux bleroux requested a review from justinmc February 29, 2024 15:42
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM with nits 👍

Thanks for fixing this! Much better this way.

overflowHeight,
);
overflowWidth = math.max(child.size.width, nextSize.width);
nextSize = Size(overflowWidth, overflowHeight);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the introduction of overflowWidth just an attempt to make this easier to read, or am I misreading this? I think you can declare it here rather than up above, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh good catch: I first introduced it because I need it at the end of this method and after moving the logic to a separate method I kept it for readability. I will move the declaration as suggested, thanks.

Copy link
Contributor Author

@bleroux bleroux Feb 29, 2024

Choose a reason for hiding this comment

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

Just pushed an update and finally I removed this variable as it does not improve readability.

size = nextSize;
}

// Horizontally expand the children when the menu overflow so they can react to
Copy link
Contributor

Choose a reason for hiding this comment

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

"overflow" => "overflows"

// Horizontally expand the children when the menu overflow so they can react to
// pointer events into their whole area.
void _resizeChildrenWhenOverflow() {
if (overflowOpen) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Maybe it's more clear as:

if (!overflowOpen) {
  return;
}

@bleroux bleroux added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 1, 2024
@auto-submit auto-submit bot merged commit 8a312cd into flutter:master Mar 1, 2024
@bleroux bleroux deleted the fix_text_selection_toolbar_buttons_width_in_overflow_menu branch March 1, 2024 06:45
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 1, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Mar 1, 2024
Roll Flutter from e92bca3 to ba719bc (37 revisions)

flutter/flutter@e92bca3...ba719bc

2024-03-01 [email protected] Fix `CalendarDatePicker` day selection shape and overlay (flutter/flutter#144317)
2024-03-01 [email protected] Fix chips use square delete button `InkWell` shape instead of circular (flutter/flutter#144319)
2024-03-01 [email protected] InputDecorator M3 tests migration - Step4 - Hint tests (flutter/flutter#144169)
2024-03-01 [email protected] Roll Flutter Engine from f0037d4fbd67 to 2a5a9a6dead0 (1 revision) (flutter/flutter#144468)
2024-03-01 [email protected] Roll Flutter Engine from 16e04d264145 to f0037d4fbd67 (1 revision) (flutter/flutter#144464)
2024-03-01 [email protected] Roll Flutter Engine from 1dff89788b18 to 16e04d264145 (1 revision) (flutter/flutter#144459)
2024-03-01 [email protected] Horizontally expand text selection toolbar buttons in overflow menu (flutter/flutter#144391)
2024-03-01 [email protected] Roll Flutter Engine from f68cc57cbe12 to 1dff89788b18 (2 revisions) (flutter/flutter#144457)
2024-03-01 [email protected] Roll Flutter Engine from 76140bc9cec9 to f68cc57cbe12 (2 revisions) (flutter/flutter#144455)
2024-03-01 [email protected] Roll Flutter Engine from f300ced56a4e to 76140bc9cec9 (1 revision) (flutter/flutter#144453)
2024-03-01 [email protected] Roll Flutter Engine from 34cf95c7bd82 to f300ced56a4e (1 revision) (flutter/flutter#144452)
2024-03-01 [email protected] Roll Flutter Engine from 0db468f7bae5 to 34cf95c7bd82 (1 revision) (flutter/flutter#144450)
2024-03-01 [email protected] Roll Flutter Engine from 6f8044436eb3 to 0db468f7bae5 (3 revisions) (flutter/flutter#144448)
2024-03-01 [email protected] Remove master from API docs (flutter/flutter#144425)
2024-03-01 [email protected] Enable missing-code-block-language (flutter/flutter#144443)
2024-03-01 [email protected] Roll Flutter Engine from 7e8fefe4a084 to 6f8044436eb3 (5 revisions) (flutter/flutter#144436)
2024-02-29 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.24.5 to 3.24.6 (flutter/flutter#144424)
2024-02-29 [email protected] Reland [a11y] Fix date picker cannot focus on the edit field  (flutter/flutter#144198)
2024-02-29 [email protected] Reland "Use dartpad's main channel for master/main docs (#144329)" (flutter/flutter#144431)
2024-02-29 [email protected] Make daemon server work on ipv6-only machines. (flutter/flutter#144359)
2024-02-29 [email protected] Remove deprecated `backgroundColor` from `ThemeData` (flutter/flutter#144079)
2024-02-29 [email protected] Add stateful reordering test for TwoDimensionalViewport (flutter/flutter#142375)
2024-02-29 [email protected] Always use local CanvasKit/Skwasm in benchmarks for better hermeticity. (flutter/flutter#144423)
2024-02-29 [email protected] Roll Flutter Engine from bb6c6a01000f to 7e8fefe4a084 (2 revisions) (flutter/flutter#144419)
2024-02-29 [email protected] Fix a crash in remote device daemon. (flutter/flutter#144358)
2024-02-29 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Use dartpad's main channel for master/main docs (#144329)" (flutter/flutter#144429)
2024-02-29 [email protected] Remove `toggleableActiveColor` from `ThemeData` (flutter/flutter#144178)
2024-02-29 [email protected] Add `FocusNode.focusabilityListenable` (flutter/flutter#144280)
2024-02-29 [email protected] Roll Flutter Engine from 1f24eaa4979d to bb6c6a01000f (2 revisions) (flutter/flutter#144416)
2024-02-29 [email protected] [devicelab] fix motog4 tests and update comment. (flutter/flutter#144410)
2024-02-29 [email protected] Bump dartdocs to 8.0.6 (flutter/flutter#144413)
2024-02-29 [email protected] Use dartpad's main channel for master/main docs (flutter/flutter#144329)
2024-02-29 [email protected] Roll Flutter Engine from 7b3ef43fa7e6 to 1f24eaa4979d (2 revisions) (flutter/flutter#144405)
2024-02-29 [email protected] Roll Flutter Engine from 7dd404724c50 to 7b3ef43fa7e6 (1 revision) (flutter/flutter#144399)
2024-02-29 [email protected] Roll Flutter Engine from 8179b0ed778e to 7dd404724c50 (3 revisions) (flutter/flutter#144395)
2024-02-29 [email protected] Roll Packages from 353086c to 6d02f03 (14 revisions) (flutter/flutter#144393)
2024-02-29 [email protected] Roll Flutter Engine from d068d980f952 to 8179b0ed778e (1 revision) (flutter/flutter#144378)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

...
LouiseHsu pushed a commit to LouiseHsu/packages that referenced this pull request Mar 7, 2024
Roll Flutter from e92bca3 to ba719bc (37 revisions)

flutter/flutter@e92bca3...ba719bc

2024-03-01 [email protected] Fix `CalendarDatePicker` day selection shape and overlay (flutter/flutter#144317)
2024-03-01 [email protected] Fix chips use square delete button `InkWell` shape instead of circular (flutter/flutter#144319)
2024-03-01 [email protected] InputDecorator M3 tests migration - Step4 - Hint tests (flutter/flutter#144169)
2024-03-01 [email protected] Roll Flutter Engine from f0037d4fbd67 to 2a5a9a6dead0 (1 revision) (flutter/flutter#144468)
2024-03-01 [email protected] Roll Flutter Engine from 16e04d264145 to f0037d4fbd67 (1 revision) (flutter/flutter#144464)
2024-03-01 [email protected] Roll Flutter Engine from 1dff89788b18 to 16e04d264145 (1 revision) (flutter/flutter#144459)
2024-03-01 [email protected] Horizontally expand text selection toolbar buttons in overflow menu (flutter/flutter#144391)
2024-03-01 [email protected] Roll Flutter Engine from f68cc57cbe12 to 1dff89788b18 (2 revisions) (flutter/flutter#144457)
2024-03-01 [email protected] Roll Flutter Engine from 76140bc9cec9 to f68cc57cbe12 (2 revisions) (flutter/flutter#144455)
2024-03-01 [email protected] Roll Flutter Engine from f300ced56a4e to 76140bc9cec9 (1 revision) (flutter/flutter#144453)
2024-03-01 [email protected] Roll Flutter Engine from 34cf95c7bd82 to f300ced56a4e (1 revision) (flutter/flutter#144452)
2024-03-01 [email protected] Roll Flutter Engine from 0db468f7bae5 to 34cf95c7bd82 (1 revision) (flutter/flutter#144450)
2024-03-01 [email protected] Roll Flutter Engine from 6f8044436eb3 to 0db468f7bae5 (3 revisions) (flutter/flutter#144448)
2024-03-01 [email protected] Remove master from API docs (flutter/flutter#144425)
2024-03-01 [email protected] Enable missing-code-block-language (flutter/flutter#144443)
2024-03-01 [email protected] Roll Flutter Engine from 7e8fefe4a084 to 6f8044436eb3 (5 revisions) (flutter/flutter#144436)
2024-02-29 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.24.5 to 3.24.6 (flutter/flutter#144424)
2024-02-29 [email protected] Reland [a11y] Fix date picker cannot focus on the edit field  (flutter/flutter#144198)
2024-02-29 [email protected] Reland "Use dartpad's main channel for master/main docs (#144329)" (flutter/flutter#144431)
2024-02-29 [email protected] Make daemon server work on ipv6-only machines. (flutter/flutter#144359)
2024-02-29 [email protected] Remove deprecated `backgroundColor` from `ThemeData` (flutter/flutter#144079)
2024-02-29 [email protected] Add stateful reordering test for TwoDimensionalViewport (flutter/flutter#142375)
2024-02-29 [email protected] Always use local CanvasKit/Skwasm in benchmarks for better hermeticity. (flutter/flutter#144423)
2024-02-29 [email protected] Roll Flutter Engine from bb6c6a01000f to 7e8fefe4a084 (2 revisions) (flutter/flutter#144419)
2024-02-29 [email protected] Fix a crash in remote device daemon. (flutter/flutter#144358)
2024-02-29 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Use dartpad's main channel for master/main docs (#144329)" (flutter/flutter#144429)
2024-02-29 [email protected] Remove `toggleableActiveColor` from `ThemeData` (flutter/flutter#144178)
2024-02-29 [email protected] Add `FocusNode.focusabilityListenable` (flutter/flutter#144280)
2024-02-29 [email protected] Roll Flutter Engine from 1f24eaa4979d to bb6c6a01000f (2 revisions) (flutter/flutter#144416)
2024-02-29 [email protected] [devicelab] fix motog4 tests and update comment. (flutter/flutter#144410)
2024-02-29 [email protected] Bump dartdocs to 8.0.6 (flutter/flutter#144413)
2024-02-29 [email protected] Use dartpad's main channel for master/main docs (flutter/flutter#144329)
2024-02-29 [email protected] Roll Flutter Engine from 7b3ef43fa7e6 to 1f24eaa4979d (2 revisions) (flutter/flutter#144405)
2024-02-29 [email protected] Roll Flutter Engine from 7dd404724c50 to 7b3ef43fa7e6 (1 revision) (flutter/flutter#144399)
2024-02-29 [email protected] Roll Flutter Engine from 8179b0ed778e to 7dd404724c50 (3 revisions) (flutter/flutter#144395)
2024-02-29 [email protected] Roll Packages from 353086c to 6d02f03 (14 revisions) (flutter/flutter#144393)
2024-02-29 [email protected] Roll Flutter Engine from d068d980f952 to 8179b0ed778e (1 revision) (flutter/flutter#144378)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: text input Entering text in a text field or keyboard related problems autosubmit Merge PR when tree becomes green via auto submit App f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Items in the overflow of the TextSelectionToolbar should take the width of the largest item

2 participants