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

DragValue not support empty content in text editing mode #2418

Closed
tkkcc opened this issue Dec 9, 2022 Discussed in #2376 · 1 comment · Fixed by #2421
Closed

DragValue not support empty content in text editing mode #2418

tkkcc opened this issue Dec 9, 2022 Discussed in #2376 · 1 comment · Fixed by #2421

Comments

@tkkcc
Copy link
Contributor

tkkcc commented Dec 9, 2022

Discussed in #2376

Originally posted by tkkcc December 4, 2022
A normal way to edit 2 into 0 is backspace + 0. Current DragValue does not support this.

@tkkcc
Copy link
Contributor Author

tkkcc commented Dec 9, 2022

One DragValue works well. Two or more DragValues boom.

The problem is ui.memory().drag_value.edit_string is shared by all DragValues. If any DragValue is not in keyboard mode(this is always true), it's update will reset edit_string to None. The current editing DragValue has to reconstruct edit_string from it's value, so boom.

same issue: #2370

tkkcc added a commit to tkkcc/egui that referenced this issue Dec 9, 2022
emilk pushed a commit that referenced this issue Dec 10, 2022
* Fix drag_value.edit_string unexpected reset

  solve issue #2418 #2370

* Also reset drag_value.edit_string on click

* Fix for clippy check
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 a pull request may close this issue.

1 participant