carbon-design-system / carbon-components-vue

Vue implementation of the Carbon Design System
http://vue.carbondesignsystem.com
Apache License 2.0
608 stars 180 forks source link

fix: emit date change event to match React #1626

Closed davidnixon closed 2 months ago

davidnixon commented 2 months ago

Contributes to #1625

What did you do?

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?

davidnixon commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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

davidnixon commented 2 months ago

@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 commented 2 months ago

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

davidnixon commented 2 months ago

carbon-vue-3.0.20-1abc8.tgz

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