- 07 Mar, 2024 1 commit
-
-
Bruno Leroux authored
## Description This PRs changes the default value transit mode for key event simulation. The default transit mode for key event simulation is currently `KeyDataTransitMode.rawKeyData` while on the framework side `KeyDataTransitMode.keyDataThenRawKeyData` is the preferred transit mode. `KeyDataTransitMode.keyDataThenRawKeyData` is more accurate and can help detect issues. For instance the following test will fail with `KeyDataTransitMode.rawKeyData` because raw keyboard logic for modifier keys is less accurate: ```dart testWidgets('Press control left once', (WidgetTester tester) async { debugKeyEventSimulatorTransitModeOverride = KeyDataTransitMode.keyDataThenRawKeyData; final List<KeyEvent> events = <KeyEvent>[]; final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); await tester.pumpWidget( Focus( focusNode: focusNode, autofocus: true, onKeyEvent: (_, KeyEvent event) { events.add(event); return KeyEventResult.handled; }, child: Container(), ), ); await simulateKeyDownEvent(LogicalKeyboardKey.controlLeft); // This will fail when transit mode is KeyDataTransitMode.rawKeyData // because a down event for controlRight is synthesized. expect(events.length, 1); debugKeyEventSimulatorTransitModeOverride = null; }); ``` And the following this test is ok with `KeyDataTransitMode.rawKeyData` but rightly fails with `KeyDataTransitMode.keyDataThenRawKeyData`: ```dart testWidgets('Simulates consecutive key down events', (WidgetTester tester) async { debugKeyEventSimulatorTransitModeOverride = KeyDataTransitMode.rawKeyData; // Simulating several key down events without key up in between is tolerated // when transit mode is KeyDataTransitMode.rawKeyData, it will trigger an // assert on KeyDataTransitMode.keyDataThenRawKeyData. await simulateKeyDownEvent(LogicalKeyboardKey.arrowDown); await simulateKeyDownEvent(LogicalKeyboardKey.arrowDown); debugKeyEventSimulatorTransitModeOverride = null; }); ``` ## Related Issue Related to https://github.com/flutter/flutter/issues/143845 ## Tests Adds two tests.
-
- 27 Feb, 2024 1 commit
-
-
hangyu authored
Reland #143334
-
- 23 Feb, 2024 1 commit
-
-
LongCatIsLooong authored
Relands "Changing `TextPainter.getOffsetForCaret` implementation to remove the logarithmic search (#143281)" (reverted in #143801) (#143954) The original PR was reverted because the new caret positioning callpath triggered a skparagraph assert. The assert has been removed. Relanding the PR with no changes applied.
-
- 21 Feb, 2024 1 commit
-
-
auto-submit[bot] authored
Reverts "Changing `TextPainter.getOffsetForCaret` implementation to remove the logarithmic search (#143281)" (#143801) Reverts flutter/flutter#143281 Initiated by: LongCatIsLooong Reason for reverting: https://github.com/flutter/flutter/issues/143797 Original PR Author: LongCatIsLooong Reviewed By: {justinmc, jason-simmons} This change reverts the following previous change: Original Description: The behavior largely remains the same, except: 1. The EOT cursor `(textLength, downstream)` for text ending in the opposite writing direction as the paragraph is now placed at the visual end of the last line. For example, in a LTR paragraph, the EOT cursor for `aA` (lowercase for LTR and uppercase for RTL) is placed to the right of the line: `aA|` (it was `a|A` before). This matches the behavior of most applications that do logical order arrow key navigation instead of visual order navigation. And it makes the navigation order consistent for `aA\naA`: ``` |aA => aA| => aA| => aA => aA => aA aA aA aA |aA aA| aA| (1) (2) (3) (4) (5) (6) ``` This is indeed still pretty confusing as (2) and (3), as well as (5) and (6) are hard to distinguish (when the I beam has a large width they are actually visually distinguishable -- they use the same anchor but one gets painted to the left and the other to the right. I noticed that emacs does the same). But logical order navigation will always be confusing in bidi text, in one way or another. Interestingly there are 3 different behaviors I've observed in chrome: - the chrome download dialog (which I think uses GTK text widgets but not sure which version) gives me 2 cursors when navigating bidi text, and - its HTML fields only show one, and presumably they place the I beam at the **trailing edge** of the character (which makes more sense for backspacing I guess). - On the other hand, its (new) omnibar seems to use visual order arrow navigation Side note: we may need to update the "tap to place the caret here" logic to handle the case where the tap lands outside of the text and the text ends in the opposite writing direction. 2. Removed the logarithmic search. The same could be done using the characters package but when glyphInfo tells you about the baseline location in the future we probably don't need the `getBoxesForRange` call. This should fix https://github.com/flutter/flutter/issues/123424. ## Internal Tests This is going to change the image output of some internal golden tests. I'm planning to merge https://github.com/flutter/flutter/pull/143281 before this to avoid updating the same golden files twice for invalid selections.
-
- 20 Feb, 2024 1 commit
-
-
LongCatIsLooong authored
The behavior largely remains the same, except: 1. The EOT cursor `(textLength, downstream)` for text ending in the opposite writing direction as the paragraph is now placed at the visual end of the last line. For example, in a LTR paragraph, the EOT cursor for `aA` (lowercase for LTR and uppercase for RTL) is placed to the right of the line: `aA|` (it was `a|A` before). This matches the behavior of most applications that do logical order arrow key navigation instead of visual order navigation. And it makes the navigation order consistent for `aA\naA`: ``` |aA => aA| => aA| => aA => aA => aA aA aA aA |aA aA| aA| (1) (2) (3) (4) (5) (6) ``` This is indeed still pretty confusing as (2) and (3), as well as (5) and (6) are hard to distinguish (when the I beam has a large width they are actually visually distinguishable -- they use the same anchor but one gets painted to the left and the other to the right. I noticed that emacs does the same). But logical order navigation will always be confusing in bidi text, in one way or another. Interestingly there are 3 different behaviors I've observed in chrome: - the chrome download dialog (which I think uses GTK text widgets but not sure which version) gives me 2 cursors when navigating bidi text, and - its HTML fields only show one, and presumably they place the I beam at the **trailing edge** of the character (which makes more sense for backspacing I guess). - On the other hand, its (new) omnibar seems to use visual order arrow navigation Side note: we may need to update the "tap to place the caret here" logic to handle the case where the tap lands outside of the text and the text ends in the opposite writing direction. 2. Removed the logarithmic search. The same could be done using the characters package but when glyphInfo tells you about the baseline location in the future we probably don't need the `getBoxesForRange` call. This should fix https://github.com/flutter/flutter/issues/123424. ## Internal Tests This is going to change the image output of some internal golden tests. I'm planning to merge https://github.com/flutter/flutter/pull/143281 before this to avoid updating the same golden files twice for invalid selections.
-
- 14 Feb, 2024 2 commits
-
-
auto-submit[bot] authored
Reverts flutter/flutter#143334 Initiated by: hangyujin Reason for reverting: broke g3 tests Original PR Author: hangyujin Reviewed By: {LongCatIsLooong} This change reverts the following previous change: Original Description: Add a semantics flag to text field to fix https://github.com/flutter/flutter/issues/143337 (in IOS the disabled text field is not read `dimmed`) internal: b/322345393
-
Michael Goderbauer authored
Follow-up to https://github.com/flutter/flutter/pull/143347.
-
- 13 Feb, 2024 1 commit
-
-
hangyu authored
Add a semantics flag to text field to fix https://github.com/flutter/flutter/issues/143337 (in IOS the disabled text field is not read `dimmed`) internal: b/322345393
-
- 06 Feb, 2024 1 commit
-
-
Renzo Olivares authored
This change affects Android and iOS devices using the TextField's context menu. After this change the context menu will fade out when scrolling the text and fade in when the scroll ends. If the scroll ends and the selection is outside of the view, then the toolbar will be scheduled to show in a future scroll end. This toolbar scheduling can be invalidated if the `TextEditingValue` changed anytime between the scheduling and when the toolbar is ready to be shown. This change also fixes a regression where the TextField context menu would not fade when the selection handles where not visible. When using the native browser context menu this behavior is not controlled by Flutter. https://github.com/flutter/flutter/assets/948037/3f46bcbb-ba6f-456c-8473-e42919b9d572 Fixes #52425 Fixes #105804 Fixes #52426
-
- 31 Jan, 2024 1 commit
-
-
Polina Cherkasova authored
-
- 30 Jan, 2024 1 commit
-
-
Renzo Olivares authored
This change uses `CapturedTheme`s to capture the themes from the context the selection handles were built in and wraps the handles with them so they can correctly inherit `Theme`s from local `Theme` widgets. `CapturedTheme`s only captures `InheritedTheme`s, so this change also makes `_InheritedCupertinoTheme` an `InheritedTheme`. This is so we can capture themes declared under a `CupertinoTheme`, for example `primaryColor` is used as the selection handle color. Fixes #74890
-
- 24 Jan, 2024 1 commit
-
-
Jesús S Guerrero authored
Revert "[web] - Fix broken `TextField` in semantics mode when it's a sibling of `Navigator`" (#142129) Reverts flutter/flutter#138446 b/322136071
-
- 22 Jan, 2024 1 commit
-
-
Hassan Toor authored
When a `TextField` is rendered before a `Navigator`, it breaks in semantics mode. This is because the framework generates the incorrect semantics tree (excludes the TextField) and when that tree gets sent to the engine, we don't get the signal to create the corresponding `<input>` element. This happens for a few reasons: * `ModalBarrier` uses `BlockSemantics` to drop the semantics of routes beneath the current route in `Navigator` * `ModalBarrier` mistakenly recognizes the widget outside of the `Navigator` to be its sibling * So we end up dropping the semantics node of the `TextField` rendered before it. The fix is to let `Navigator` generate a semantics node so that `ModalBarrier` doesn't mistakenly think widgets outside of `Navigator` are its siblings. `Navigator` doesn't currently do this, which causes all the nodes generated from its widget subtree to be directly attached to the parent semantics node above `Navigator` - since this is also the parent of `TextField`, it considers them siblings. Fixes https://github.com/flutter/flutter/issues/129324
-
- 16 Jan, 2024 1 commit
-
-
Anis Alibegić authored
I continued [my mission](https://github.com/flutter/flutter/pull/141431) to find as many typos as I could. This time it's a smaller set than before. There is no need for issues since it's a typo fix.
-
- 12 Jan, 2024 1 commit
-
-
Anis Alibegić authored
Fair amount of typos spotted and fixed. Some of them are in comments, some of them are in code and some of them are in nondart files. There is no need for issues since it's a typo fix. I have doubts about [packages/flutter_tools/lib/src/ios/core_devices.dart](https://github.com/flutter/flutter/compare/master...anisalibegic:flutter:master#diff-fdbc1496b4bbe7e2b445a567fd385677af861c0093774e3d8cc460fdd5b794fa), I have a feeling it might broke some things on the other end, even though it's a typo.
-
- 10 Jan, 2024 1 commit
-
-
Polina Cherkasova authored
Contributes to https://github.com/flutter/devtools/issues/6909.
-
- 03 Jan, 2024 1 commit
-
-
yim authored
This PR changes the regular cursor to a floating cursor when a long press occurs. This is a new feature. Fixes #89228
-
- 27 Dec, 2023 1 commit
-
-
Harry Terkelsen authored
Re-enables skipped flaky test now that the underlying cause of flakiness (GPU memory leak) has been fixed in the engine and the fix has rolled into the framework. The fix is here: https://github.com/flutter/engine/pull/49336 Fixes https://github.com/flutter/flutter/issues/137669
-
- 21 Dec, 2023 1 commit
-
-
auto-submit[bot] authored
Reverts flutter/flutter#140462 Initiated by: cbracken This change reverts the following previous change: Original Description: The test was flaky before due to overflowing GPU memory during the test. The memory leak was fixed here https://github.com/flutter/engine/pull/49214 Fixes https://github.com/flutter/flutter/issues/137669 As a side effect of the fix, this test also runs much faster, from about 3 minutes on my Macbook down to about 25 seconds.
-
- 20 Dec, 2023 1 commit
-
-
Harry Terkelsen authored
The test was flaky before due to overflowing GPU memory during the test. The memory leak was fixed here https://github.com/flutter/engine/pull/49214 Fixes https://github.com/flutter/flutter/issues/137669 As a side effect of the fix, this test also runs much faster, from about 3 minutes on my Macbook down to about 25 seconds. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
-
- 15 Dec, 2023 2 commits
-
-
Polina Cherkasova authored
-
Mitchell Goodwin authored
Fixes #123107 Adds a customizable semantic label so that the clear button on the Cupertino text field will be picked up by screen readers. https://github.com/flutter/flutter/assets/58190796/de31d9dd-923c-402f-a55b-e5cc77ea68bb
-
- 11 Dec, 2023 1 commit
-
-
Greg Spencer authored
## Description This starts the deprecation of the `RawKeyEvent`/`RawKeyboard` event system that has been replaced by the `KeyEvent`/`HardwareKeyboard` event system. Migration guide is available here: https://docs.flutter.dev/release/breaking-changes/key-event-migration ## Related Issues - https://github.com/flutter/flutter/issues/136419 ## Related PRs - https://github.com/flutter/website/pull/9889
-
- 08 Dec, 2023 1 commit
-
-
Bruno Leroux authored
## Description This PR adds the 'Share' button to the text selection toolbar on Android. ## Related Issue Fixes https://github.com/flutter/flutter/issues/138728 ## Tests Refactor a lot of existing tests in order to: - make them more readable (avoid duplication by introducing helper functions, specify explictly check which buttons are expected). - make them more accurate (check that expected buttons are visible instead of just checking the number of buttons). For instance, previous tests contained sections such as: ```dart // Collapsed toolbar shows 3 buttons. expect( find.byType(CupertinoButton), isContextMenuProvidedByPlatform ? findsNothing : isTargetPlatformIOS ? findsNWidgets(6) : findsNWidgets(3) ); ``` Where the comment is obsolete, the two cases (6 widgets and 3 widgets) are not explicit (which buttons are expected?), and not accurate (will pass if the number of buttons is right but the buttons are the wrong ones).
-
- 15 Nov, 2023 1 commit
-
-
Yegor authored
Skipping the test due to https://github.com/flutter/flutter/issues/137669. It's not clear which PR started it, so we can't revert anything, and the fix is not yet clear either. However, the flakiness is very high and is disruptive to the Flutter team.
-
- 11 Oct, 2023 1 commit
-
-
Polina Cherkasova authored
Fix flakiness: finalize dropped gestures in tests to release resources, and update doc-comment. (#136136)
-
- 02 Oct, 2023 2 commits
-
-
Kostia Sokolovskyi authored
-
derdilla authored
-
- 22 Sep, 2023 1 commit
-
-
Tomasz Gucio authored
-
- 13 Sep, 2023 1 commit
-
-
LongCatIsLooong authored
Hopefully this fixes https://github.com/flutter/flutter/issues/110076 by removing the `Path.combine` call. Not sure how I can verify in a test that `Path.combine` is not called.
-
- 08 Sep, 2023 1 commit
-
-
LongCatIsLooong authored
Fixes https://github.com/flutter/flutter/issues/133241 and some CupertinoTextField cleanup.
-
- 17 Aug, 2023 1 commit
-
-
LouiseHsu authored
In native iOS, users are able to select text and initiate a share menu, which provides several standard services, such as copy, sharing to social media, direct ability to send to various contacts through messaging apps, etc. https://github.com/flutter/engine/assets/36148254/d0af7034-31fd-412e-8636-a06bbff54765 This PR is the framework portion of the changes that will allow Share to be implemented. The corresponding merged engine PR is [here](https://github.com/flutter/engine/pull/44554) This PR addresses https://github.com/flutter/flutter/issues/107578 More details are available in this [design doc](https://github.com/flutter/engine/pull/flutter.dev/go/add-missing-features-to-selection-controls)
-
- 16 Aug, 2023 1 commit
-
-
Renzo Olivares authored
This PR makes sure we do not select beyond the text boundary at the tapped position unless, we tap at the end of the text which in that case we should select the previous text boundary. ```dart // if x is a boundary defined by `textBoundary`, most textBoundaries (except // LineBreaker) guarantees `x == textBoundary.getLeadingTextBoundaryAt(x)`. // Use x - 1 here to make sure we don't get stuck at the fixed point x. final int start = textBoundary.getLeadingTextBoundaryAt(extent.offset - 1) ?? 0; ``` This was originally carried over from https://github.com/flutter/flutter/blob/f468f3366c26a5092eb964a230ce7892fda8f2f8/packages/flutter/lib/src/widgets/editable_text.dart#L4167-L4179 which used this `x - 1` to be able to move to the previous word boundary when navigating with a keyboard. When selecting by tapping/clicking we do not want to move past the text boundary at the tapped position so this adjustment is not needed. Fixes #132126
-
- 08 Aug, 2023 1 commit
-
-
LouiseHsu authored
This PR adds framework support for the Search Web feature in iOS. https://github.com/flutter/flutter/assets/36148254/c159f0d9-8f14-45e7-b295-e065b0826fab The corresponding merged engine PR can be found [here](https://github.com/flutter/engine/pull/43324). This PR addresses https://github.com/flutter/flutter/issues/82907 More details are available in this [design doc](https://docs.google.com/document/d/1QizXwBiO-2REIcEovl5pK06BaLPOWYmNwOE5jactJZA/edit?resourcekey=0-1pb9mJiAq29Gesmt25GAug)
-
- 07 Aug, 2023 1 commit
-
-
Kate Lovett authored
Fixes https://github.com/flutter/flutter/issues/59413 This relocates `mock_canvas.dart` and `recording_canvas.dart` from `flutter/test/rendering` to `flutter_test`. The testing functionality afforded by mock_canvas should be available to everyone, not just the framework. :) mock_canvas.dart needed a bit of cleanup - things like formatting and super parameters.
-
- 02 Aug, 2023 1 commit
-
-
LouiseHsu authored
This PR adds framework support for the Look Up feature in iOS. https://github.com/flutter/flutter/assets/36148254/d301df79-4e23-454f-8742-2f8e39c2960c The corresponding merged engine PR can be found [here](https://github.com/flutter/engine/pull/43308). This PR addresses https://github.com/flutter/flutter/issues/82907 More details are available in this [design doc.](flutter.dev/go/add-missing-features-to-selection-controls) This is the same PR as https://github.com/flutter/flutter/pull/130532, this is an attempt to fix the Google Testing issue
-
- 06 Jul, 2023 1 commit
-
-
luckysmg authored
iOS OCR keyboard input support.
-
- 27 Jun, 2023 1 commit
-
-
Luccas Clezar authored
CupertinoTextSelectionToolbar is different from the native one, with some UI and UX issues. More details on the linked issue. https://github.com/flutter/flutter/issues/127756 Currently the only problem that I listed on the linked issue that I couldn't fix was the horizontal scrolling, but to workaround this I added a GestureDetector to change pages when swiping the toolbar. It's not exactly the same as native as there is no scroll animation, but it works. I'm creating this PR a little early to have some feedback as these changes were more complex than the ones in my last PR. Probably best if @justinmc is involved ð |Version|Video| |-|-| |Flutter Old|<video src="https://github.com/flutter/flutter/assets/12024080/7cf81075-46ec-4970-b118-cc27b60ddac0"></video>| |Flutter New|<video src="https://github.com/flutter/flutter/assets/12024080/c9e27a53-f94c-4cb0-9b76-e47b73841dcb"></video>| |Native|<video src="https://github.com/flutter/flutter/assets/12024080/468c7d5b-ba93-4bd4-8f6e-8ec2644b9866"></video>|
-
- 15 May, 2023 1 commit
-
-
Tomasz Gucio authored
-
- 12 May, 2023 1 commit
-
-
Justin McCandless authored
Desktop text selection toolbar no longer flashes before closing.
-