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

TextInput paragraph state cache #2318

Open
2 tasks done
tzemanovic opened this issue Mar 9, 2024 · 0 comments
Open
2 tasks done

TextInput paragraph state cache #2318

tzemanovic opened this issue Mar 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tzemanovic
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

Hi, I’m using iced with bevy using https://github.com/tasgon/bevy_iced and I’m trying to update it from iced 0.10 to 0.12, but the integration of TextInput seems to be affected by the state caching introduced in #2058.

The issue is that the paragraph update applied in TextInput’s on_event in by the update_cache closure sometimes gets out of sync with the actual value, because in the integration the input message is passed via bevy’s event system which is sometimes delayed by a frame, which causes the input to flicker.

From what I can see the flicker is due to fn offset being calculated using the cache state before the actual value is updated via the propagated event. This is even worse with .secure(true) input where the raw input is shown for a frame. I’m not yet too familiar with the iced internals so I’m not sure what would be a right approach to fix this (and if there are any other widgets that may be affected by this?), but I’m happy to collaborate on a patch. When I removed the call to update_cache the problem in the integration goes away.

What is the expected behavior?

Visual integrity on text input. Cache should not affect the view before the event is processed by the app.

Version

crates.io release

Operating System

Linux

Do you have any log output?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant