Skip to content

Conversation

LongCatIsLooong
Copy link
Contributor

@LongCatIsLooong LongCatIsLooong commented Apr 2, 2021

Fixes #79495

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@LongCatIsLooong LongCatIsLooong requested a review from justinmc April 2, 2021 04:12
@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Apr 2, 2021
@google-cla google-cla bot added the cla: yes label Apr 2, 2021
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 👍

Maybe run the Google tests on this before merge? If you think there's any risk of a cursor no longer being painted in a visual test.

expect(editable, paints..paragraph());
// No longer paints the caret.
expect(editable, isNot(paints..rect(color: Colors.red[500])),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: This parenthesis should be on the previous line I think.

@LongCatIsLooong
Copy link
Contributor Author

Not going to merge this just yet. I'll wait for #79656 to be rolled and do a TGP.

@xu-baolin
Copy link
Member

The behavior after this patch is consistent with the native behavior(desktop and mobile), right?
I think this is probably a big breaking change, we should explain in the document, of course, this should be done if the native behavior is also the same!

@LongCatIsLooong
Copy link
Contributor Author

@xu-baolin I have not tested on native platforms but not painting the caret seems to be the only approach that makes sense. I'll run all customer tests to figure out whether this is a breaking change. This PR depends on a breaking change #79656 so I'll have to wait for that commit to get rolled first.

@LongCatIsLooong
Copy link
Contributor Author

LongCatIsLooong commented Apr 9, 2021

It does break internal tests: internal link. I'm creating a migration guide.

@fluttergithubbot fluttergithubbot merged commit 0f8148e into flutter:master Apr 18, 2021
@LongCatIsLooong LongCatIsLooong deleted the dont-paint-invalid-selection branch April 18, 2021 20:33
renyou added a commit that referenced this pull request Apr 23, 2021
renyou added a commit that referenced this pull request Apr 23, 2021
renyou added a commit to renyou/flutter that referenced this pull request Apr 25, 2021
renyou added a commit that referenced this pull request Apr 26, 2021
…81076 (#81155)

* Revert "Replace some `dynamic` to `Object?` type (#80772)" (#80965)

This reverts commit 12a2e68.

* Add frontend_server_client to dependency allowlist (#80912)

* Revert "[RenderEditable] Dont paint caret when selection is invalid (#79607)" (#81076)

This reverts commit 0f8148e.

* Convert AnimatedSize to a StatefulWidget (#80554)

Co-authored-by: Jenn Magder <magder@google.com>
Co-authored-by: Jason Simmons <jason-simmons@users.noreply.github.com>
auto-submit bot pushed a commit that referenced this pull request Feb 16, 2024
Fixes #79495

This is basically a reland of #79607.

Currently when the cursor is invalid, arrow key navigation / typing / backspacing doesn't work since the cursor position is unknown. 
Showing the cursor when the selection is invalid gives the user the wrong information about the current insert point in the text. 

This is going to break internal golden tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RenderEditable should not show the caret when the selection is invalid (i.e. (-1, -1))
4 participants