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

PlainEditor: cursor disappears when all text is deleted #183

Open
mwcampbell opened this issue Nov 21, 2024 · 3 comments
Open

PlainEditor: cursor disappears when all text is deleted #183

mwcampbell opened this issue Nov 21, 2024 · 3 comments

Comments

@mwcampbell
Copy link
Contributor

I can reproduce this in both vello_editor and in a Xilem single-line textbox after xilem#616. Based on the fact that in the latter case, the textbox shrinks, it appears that the layout also doesn't have a single line or run when there's no text. This also breaks accessibility. When there's no text, there should always be a single line with a single run, so there's somewhere for the cursor to be located.

@dfrg
Copy link
Collaborator

dfrg commented Nov 21, 2024

I believe #170 fixes this.

@mwcampbell
Copy link
Contributor Author

It doesn't. In vello_editor running on the latest commit in #170, if I press Ctrl+A followed by Delete, the cursor still disappears.

@dfrg
Copy link
Collaborator

dfrg commented Nov 21, 2024

Oops, this was working but I pushed a change that broke it:

if text.is_empty() && !inline_boxes.is_empty() {

The condition for inline boxes is inverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants