Skip to content

fix: emit date change event to match React #1626

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

Merged

Conversation

davidnixon
Copy link
Contributor

@davidnixon davidnixon commented Sep 18, 2024

Contributes to #1625

What did you do?

  • some minor eslint-style changes to the story to put @ items at the end of the attribute list i.e. @change="onChange"
  • some minor tidying of controls on stories
  • add new emit for dateChange this event mimics the change event in the Carbon React
  • separate the v-model stories for a single kind and range kind. The v-model is different for each of these and I think separating the stories makes it a bit clearer.
  • for single kind and range kind stories, show the dateChange in the actions tab

Why did you do it?

See #1625 but basically there was no way to listen for changes for a range style date picker.

How have you tested it?

Via the storybook

Were docs updated if needed?

  • Yes

@davidnixon
Copy link
Contributor Author

The change event is unchanged. It still emits a native change event for the underlying input. This is used for kind simple and short.
image

The change event is still emitted for kind single and range but ti is not shown in the storybook.

@davidnixon
Copy link
Contributor Author

For kinds single and range the new dateChange event is emitted. The param passed to the event is an array of Date objects. For a kind single this array has 1 entry. For a kind range, the array has 2 entries.
image

@davidnixon
Copy link
Contributor Author

For a kind range, the array has 2 entries.
image

@davidnixon
Copy link
Contributor Author

@gabisinhas
Can you have a look at this one and lmk. I did consider changing the change event but that would potentially break anyone who is currently using that event. That's why I decided on the dateChange event.

@gabisinhas
Copy link

@davidnixon i think it might resolve this. If you can publish then I can test it. thanks for the attention to this issue.

@davidnixon
Copy link
Contributor Author

carbon-vue-3.0.20-1abc8.tgz

npm remove @carbon/vue
npm add carbon-vue-3.0.20-1abc8.tgz

@davidnixon davidnixon merged commit bedce50 into carbon-design-system:main Sep 23, 2024
7 checks passed
@davidnixon davidnixon deleted the fix-date-range-change branch January 11, 2025 18:07
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

Successfully merging this pull request may close these issues.

2 participants