Skip to content
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

[web] Fix framework material text field tests #25367

Merged
merged 1 commit into from
Apr 2, 2021

Conversation

mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Apr 1, 2021

This PR does two things, to fix material text field tests in the framework:

1. Handling clicks above/below the paragraph

When a click is received above the paragraph, we used to return the beginning of the paragraph as the result position. But Flutter does this slightly differently.

Example: for the string "Lorem ipsum", if the user clicks between "i" and "p", the cursor is placed between "i" and "p". This has always been fine. But if the user clicks between "i" and "p" on the X axis, but above the text on the Y axis, the web engine used to place the cursor at the beginning of the paragraph (at position 0). This will now be fixed so it places the cursor between "i" and "p".

2. Assertions

The assertion in the extendTo method was supposed to help catch mistake in the layout algorithm. But so far it has caused more harm than good. So I'm removing it instead of adding more and more edge cases to it.

Related issue: flutter/flutter#79070

@mdebbar mdebbar added the platform-web Code specifically for the web engine label Apr 1, 2021
@mdebbar mdebbar requested a review from yjbanov April 1, 2021 20:51
@google-cla google-cla bot added the cla: yes label Apr 1, 2021
Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes platform-web Code specifically for the web engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants