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

Existence of possiblity to induce incoherency between style and state in Granite.ValidatedEntry #587

Open
adithyankv opened this issue Feb 1, 2022 · 0 comments

Comments

@adithyankv
Copy link

What Happened?

Currently it is possible to set the is_valid property of Granite.ValidatedEntry independent of its changed signal, however the style is only updated in the connect_after callback for the changed signal, so it the style only changes when the text attribute is changed. This has the possibility of leaving the widget in an incoherent state where the style doesn't reflect the value of the is_valid property.

Steps to Reproduce

change the is_valid property without using the changed signal

var entry = new Granite.ValidatedEntry ();
entry.text = "text";
entry.is_valid = false;

here even though the state is invalid the styling would reflect a valid state

Expected Behavior

I'm not entirely sure as to what the expected behavior here is, as this is more of a developer facing issue than a user facing issue. This is not even really an issue if the intended behavior is to use the is_valid property exclusively inside the changed signal. But it is weird that the API allows for the incoherence.

Supporting the change of is_valid outside the changed signal could be useful in cases where the validation condition might change outside of the widget without the value inside the widget changing. However this could be outside the scope of Granite.ValidatedEntry.

OS Version

6.x (Odin)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

No response

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

1 participant