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

Using calendar to select date causes an error in the javascript console #238

Closed
jordanjones243 opened this issue Oct 19, 2022 · 6 comments · Fixed by #256
Closed

Using calendar to select date causes an error in the javascript console #238

jordanjones243 opened this issue Oct 19, 2022 · 6 comments · Fixed by #256
Assignees
Labels
auro-input Type: Bug Bug or Bug fixes

Comments

@jordanjones243
Copy link
Contributor

jordanjones243 commented Oct 19, 2022

Describe the bug

When using the calendar to select a date and the input field is empty, we get an error in the javascript console of the developer tools.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://auro.alaskaair.com/components/auro/datepicker
  2. Open the browser's javascript console
  3. Click on the datepicker
  4. Select a date
  5. See error

There is a suspicion that this is coming from auro-input and features related to auto formatting.

Expected behavior

When a user adds a new date to a date picker, there is no error.

Recommended action

Look into how dates are being passed to input and see where the conflict is with input and cleave.js formatting the date. When there is an issue discovered be sure to create a NEW issue with auro-input documenting this issue and link back this issue.

Exit criteria

This issue will be considered closed once there is a demonstrated use case that does not throw the error.

Screenshots

Screen Shot 2022-10-19 at 3 32 19 PM

@jordanjones243 jordanjones243 added auro-datepicker not-reviewed Issue has not been reviewed by Auro team members Type: Bug Bug or Bug fixes labels Oct 19, 2022
@jordanjones243 jordanjones243 self-assigned this Oct 19, 2022
@jordanjones243
Copy link
Contributor Author

This bug is coming from an implementation error in CleaveJS. What's happening is that the getPostDelimiter method in CleaveJS is throwing an error because one of the method's parameters uses the last known value of auro-input. When we select a date using the calendar when the datepicker is in it's default state, auro-input.value = undefined, hence why this error is being thrown.

This error does not affect the functionality of the datepicker, but logs an error on something that is going on behind the scenes and what users will likely never see. This bug will be put on hold until we can talk about it during `finement and determine the best solution.

@blackfalcon
Copy link
Member

What do you think about putting a console.warn statement in the code where this happens that references this issue? That way we don't lose track of this conversation and are reminded that we know why that error is there.

@jordanjones243
Copy link
Contributor Author

What do you think about putting a console.warn statement in the code where this happens that references this issue? That way we don't lose track of this conversation and are reminded that we know why that error is there.

That is a good idea, will do.

@jordanjones243 jordanjones243 removed the not-reviewed Issue has not been reviewed by Auro team members label Oct 21, 2022
@blackfalcon blackfalcon added the not-reviewed Issue has not been reviewed by Auro team members label Nov 23, 2022
@blackfalcon
Copy link
Member

Unable to consistently reproduce this error. In a phone meeting, @blackfalcon was NOT able to repro, but @jordanjones243 IS able to repro.

There is a WARN in the code that references this issue. @jordanjones243 will take a stab to look into this a little more and report back findings.

@blackfalcon blackfalcon removed the not-reviewed Issue has not been reviewed by Auro team members label Dec 14, 2022
@blackfalcon
Copy link
Member

@blackfalcon blackfalcon added the not-reviewed Issue has not been reviewed by Auro team members label Jan 20, 2023
@blackfalcon blackfalcon removed not-reviewed Issue has not been reviewed by Auro team members Type: Bug Bug or Bug fixes labels Jan 25, 2023
@jason-capsule42
Copy link
Member

I believe this issue is tied to when datepicker is setting the input to an empty string and auro-input is trying to parse that using CleaveJS into a valid date.

This isn't an issue with datepicker itself but rather with auro-input. We need to prevent our auto-formatting from trying to happen against empty strings.

Moving this ticket auro-input.

@jason-capsule42 jason-capsule42 transferred this issue from AlaskaAirlines/auro-datepicker Mar 21, 2023
@blackfalcon blackfalcon added Type: Bug Bug or Bug fixes auro-input and removed auro-datepicker labels Mar 21, 2023
@jason-capsule42 jason-capsule42 self-assigned this May 18, 2023
@jordanjones243 jordanjones243 linked a pull request May 18, 2023 that will close this issue
6 tasks
@jordanjones243 jordanjones243 self-assigned this May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auro-input Type: Bug Bug or Bug fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants