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

Time picker UI not reflecting actual element value #174

Open
Simopich opened this issue May 28, 2024 · 5 comments
Open

Time picker UI not reflecting actual element value #174

Simopich opened this issue May 28, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Simopich
Copy link

Hi, first of all, thanks for the great library!

I've just encountered a problem while using the time picker.
I have a variable bound to the picker element that has value "02:25", so the UI shows something like this:
UI Before

Now, if I change the hour to, let's say, "11", the UI changes to become like this:
UI After

It already shows the minutes as selected, so the users could think that the current variable value is "11:25", but it's not!
It's still "02:25" until you select the minutes again, so you'd need to press the already selected minute "25" if you want to actually update the variable value.

I think the most logical option would be a variable update when you change the hour too, but let me know what you think!

Thanks again,
Simone.

@mskocik
Copy link
Owner

mskocik commented May 28, 2024

Can you past simple example in REPL?

@Simopich
Copy link
Author

Sure, I just noticed that this happens only in pickerOnly mode.
REPL here

@mskocik
Copy link
Owner

mskocik commented May 28, 2024

When you set autocommit={false} then the behaviour is clear, because you need to press OK button to confirm new selection. Without it... it's probably bug, but I thought I consider this use-case as well. Will need to look into it deeper. And hopefully I will remember, why it's done the way it is 😄

@mskocik mskocik added the bug Something isn't working label May 28, 2024
@Simopich
Copy link
Author

I may have found another bug that seems to be related to this in the time picker with the following options: pickerOnly, isRange, autocommit set to false.

If you choose an hour (hour only, no minutes selected) in the first time picker greater than the second one and press OK, the UI shows a completely wrong state that doesn't reflect the variable value.

Example:

I've set the initial picker value to: ["02:25", "16:40"]
UI

If you press "17" in the first picker and click OK, the UI shows "40" as the selected minute in the first picker but the actual variable value becomes "17:25", which I think is inconsistent (And the same thing automatically occurs in the second picker, the hour changes in the UI because the first time can't be greater than the second one but the actual variable value stays at "16:40").
UI

What do you think?

REPL

@mskocik
Copy link
Owner

mskocik commented May 28, 2024

Definitely a bug, it seems, that internal dates are "swapped" at some point, when editing first time.

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

2 participants