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

Set value on calcite-input-time-picker works incorrectly when default value exists #4206

Closed
fendiaoxiaoshuazi opened this issue Mar 7, 2022 · 4 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. bug Bug reports for broken functionality. Issues should include a reproduction of the bug.

Comments

@fendiaoxiaoshuazi
Copy link

Actual Behavior

When the default value exists on the calcite-input-time-picker, the set value on the input time picker will work incorrectly.

For example, the input time picker has the default value of 11:00, when I try to set the input time picker's value to 14:30 by code, the input time picker will receive an incorrect value 14:00:00. (Note: if the input time picker does not have the default value, set value can work correctly.)

image

Expected Behavior

The value should be set correctly on the input time picker when the default value exists.

Reproduction Sample

https://codepen.io/nan9266/pen/XWzzaxM?editors=1111

Reproduction Steps

  1. Open the console
  2. Click on the "change time as 14:30" button
    • Do not manually change the value of the input time picker before clicking the button
  3. Observe the UI and console both shows incorrect value

Reproduction Version

1.0.0-beta.72

Relevant Info

No response

Regression?

No response

@fendiaoxiaoshuazi fendiaoxiaoshuazi added 0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. needs triage Planning workflow - pending design/dev review. labels Mar 7, 2022
@fendiaoxiaoshuazi
Copy link
Author

The issue was found in the Survey123 JS API. When the time question has the default value, and they want to change the value through the JS function, the value cannot be set correctly.

@eriklharper
Copy link
Contributor

Thanks for reporting this and reproducing the issue! I am the original author of this component and have verified this locally. It appears to be caused by the internal calciteTimePickerChange event listener sending an incorrect time value back up to the input component. I can fix this by making the internal time-picker component respect direct value setting so that it doesn't interfere with direct value setting in the input component.

@benelan benelan added this to the Sprint 03/14 - 03/25 milestone Mar 14, 2022
@benelan benelan added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Mar 14, 2022
@eriklharper eriklharper added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels May 18, 2022
@github-actions github-actions bot assigned benelan and geospatialem and unassigned eriklharper May 18, 2022
@github-actions
Copy link
Contributor

Installed and assigned for verification.

@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels May 26, 2022
@geospatialem
Copy link
Member

Verified on next

change time fix verification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. bug Bug reports for broken functionality. Issues should include a reproduction of the bug.
Projects
None yet
Development

No branches or pull requests

4 participants