Skip to content

Selection controls don't move when their text widget is scrolled #3861

@mpcomplete

Description

@mpcomplete

Put an Input control inside a Scrollable view and select some text. When you scroll the view, the selection controls (handles and toolbar) don't move.

We need some way of informing the selection UI that the Input has been moved. We don't have a generalized way of doing this yet. @Hixie's thoughts on the matter:

so yeah, fundamentally the answer to your question is no, widgets (or more to the point, render objects), have no idea if they're being moved. This is an issue with, e.g., Material ink splashes; if you put a button in a rotating animation and the animation in a Material and tap the button, the splash will go all wrong.
we have a workaround for lists specifically, lists bubble a ScrollNotification. but that doesn't help in the general case.
there is a theory that one solution would be to do this at the layer level
we could have a layer that is pinned to the position of another layer
since that's the one tree that we do walk entirely each frame
so then whatever logic you wanted to do could be hooked up to the layer
e.g. if you wanted the selection handles to track the selection, you'd put the text field in a layer, the handles in a layer, and you'd tell the handles layer to track the global position of the selection layer
we don't have any support for this right now. @abarth might have ideas for how it should look, he's our layers guy.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions