Skip to content

Conversation

@yehorh
Copy link

@yehorh yehorh commented Nov 16, 2021

This PR adds to the Draggable new parameter, the feedbackCursor, which changes a cursor when a pointer over the feedback widget. This is necessary because the feedback becomes invisible to the hit test, which means that the cursor cannot be redefined further down of the widget tree.

Fix #92083

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 this 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.

This PR adds to the Draggable new parameter, the feedbackCursor, which changes a cursor when a pointer over the feedback widget. This is necessary because the feedback becomes invisible to the hit test, which means that the cursor cannot be redefined further down of the widget tree.

Fix flutter#92083
@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Nov 16, 2021
@google-cla google-cla bot added the cla: yes label Nov 16, 2021

/// The mouse cursor for mouse pointers that are over the [feedback].
///
/// When a mouse is over the [feedback], its cursor will be changed to the [cursor].
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be redundant with the first sentence?

Copy link
Author

Choose a reason for hiding this comment

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

This seems to be redundant with the first sentence?

Rewrote, I hope it will be cleaner.

///
/// When a mouse is over the [feedback], its cursor will be changed to the [cursor].
///
/// The [cursor] defaults to [MouseCursor.defer]
Copy link
Member

Choose a reason for hiding this comment

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

cursor -> feedbackCursor?

Copy link
Author

Choose a reason for hiding this comment

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

cursor -> feedbackCursor?

Fixed 😨

@goderbauer
Copy link
Member

Looks like the docs check is also unhappy, can you take a look please?

@yehorh
Copy link
Author

yehorh commented Nov 18, 2021

Looks like the docs check is also unhappy, can you take a look please?

Now it should be better. I hope.

await _testChildAnchorFeedbackPosition(tester: tester, left: 100.0, top: 100.0);
});

testWidgets('Drag feedback change cursor correctly', (WidgetTester tester) async {

Choose a reason for hiding this comment

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

Just a small one, but I would say that there is an s missing.
changes should be the correct spelling 🤔

Copy link
Author

Choose a reason for hiding this comment

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

Thanks. I will be more careful next time. 😓

@goderbauer goderbauer requested a review from Piinks December 1, 2021 22:46
/// The data that will be dropped by this draggable.
final T? data;

/// The cursor for a mouse pointer when the pointer is over the [feedback].
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean when the pointer is hovering over the feedback, the child or both? Or is it specific to when drag is active? Can you add more docs here to explain? Thanks!

@Piinks
Copy link
Contributor

Piinks commented Dec 13, 2021

I see this comment in an email about this change, but not here:

@Piinks
But the feedback widget is visible only when drag is active 😓. How I can clearly explain this without empty-pose?

Good point! I don't think it would be wasteful to clarify this is the documentation.

Currently, it says:

The cursor for a mouse pointer when the pointer is over the [feedback].

I think the over part might be what is confusing. If the feedback widget is only visible when drag is active, when would the pointer not be over it? Making this a little clearer and easier to understand is what I was suggesting. :)

@goderbauer
Copy link
Member

@yehorh Do you have plans to come back to this and update the docs per @Piinks' feedback?

@goderbauer
Copy link
Member

@Piinks as discussed in triage, can you pick this up and close it?

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.

MouseRegion's cursor in a Draggable's feedback does not work

4 participants