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

Update DragValue when focus is lost #3451

Closed
wants to merge 1 commit into from

Conversation

YgorSouza
Copy link
Contributor

Closes #2877.

@YgorSouza YgorSouza force-pushed the drag-value-update-on-tab branch from 8c2a408 to 0032761 Compare October 8, 2023 19:17
@YgorSouza
Copy link
Contributor Author

I came up with this not so elegant solution which consists of always drawing both the TextEdit and the Button, and making one of them invisible. This is both to ensure that the Ids don't change when we toggle between states, and to give the TextEdit a chance to update the value after it has lost focus.

As far as I can tell, there is only one case where it still doesn't work: when we click away from the DragValue directly into a TextEdit that was painted after it. This is due to #2142.

In other cases (pressing Tab or Shift + Tab, clicking on empty space or another type of widget, or clicking on a TextEdit painted before the current one) it updates correctly. However, this adds a penalty in performance, as there are always two widgets being added now. And I'm not sure how this affects accessibility, as I have no experience with that. I'm just leaving this PR for consideration in case no one comes up with a better solution.

@YgorSouza YgorSouza marked this pull request as ready for review October 8, 2023 19:30
@emilk
Copy link
Owner

emilk commented Jan 6, 2024

I agree that the solution isn't so elegant :)

I came up with something else in #3776

@emilk emilk closed this in #3776 Jan 6, 2024
@emilk emilk closed this in b6fe244 Jan 6, 2024
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

Successfully merging this pull request may close these issues.

Keyboard navigation: focus change loses new value in DragValue
2 participants