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

fix(vue): v-model does not update when other events bubble up #425

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Mar 25, 2024

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally for affected output targets
  • Tests (npm test) were run locally and passed
  • Prettier (npm run prettier) was run locally and passed

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue URL: resolves #424

What is the new behavior?

  • The Vue wrappers only update the v-model on an element when the event originated from that element and not from any descendant elements.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Dev build: 0.0.1-dev.11711372539.10de27e3

Verified this issue is fixed using an Ionic Framework build in the sample app from the linked issue.

* the v-model for Component A when ionChange originates from that element and not
* when ionChange bubbles up from Component B.
*/
if (e.target.tagName === el.tagName) {
Copy link
Member

@rwaskiewicz rwaskiewicz Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it guaranteed that at least one of these two values can never be undefined/null? My only thought here is running into a case where we end up doing:

if (undefined === undefined) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Element.tagName is always defined.

If e.target is defined then it should be an Element (which means tagName is defined). However, EventTarget can potentially be null. My understanding is that target can be null when an event is created but not dispatched on an element. You can test this by logging new CustomEvent('foo'). In this case, the event is dispatched on an element, so target should be non-null.

@liamdebeasi liamdebeasi merged commit d8b4069 into main Mar 26, 2024
5 checks passed
@liamdebeasi liamdebeasi deleted the ld/vue-bubble branch March 26, 2024 17:25
github-merge-queue bot pushed a commit to ionic-team/ionic-framework that referenced this pull request Apr 2, 2024
…29243)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@stencil/vue-output-target](https://stenciljs.com/)
([source](https://togithub.com/ionic-team/stencil-ds-output-targets)) |
[`0.8.7` ->
`0.8.8`](https://renovatebot.com/diffs/npm/@stencil%2fvue-output-target/0.8.7/0.8.8)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@stencil%2fvue-output-target/0.8.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@stencil%2fvue-output-target/0.8.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@stencil%2fvue-output-target/0.8.7/0.8.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@stencil%2fvue-output-target/0.8.7/0.8.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>ionic-team/stencil-ds-output-targets
(@&#8203;stencil/vue-output-target)</summary>

###
[`v0.8.8`](https://togithub.com/ionic-team/stencil-ds-output-targets/releases/tag/%40stencil/vue-output-target%400.8.8)

[Compare
Source](https://togithub.com/ionic-team/stencil-ds-output-targets/compare/a3588e905186a0e86e7f88418fd5b2f9531b55e0...@stencil/vue-output-target@0.8.8)

#### What's Changed

- fix(vue): v-model does not update when other events bubble up by
[@&#8203;liamdebeasi](https://togithub.com/liamdebeasi) in
[ionic-team/stencil-ds-output-targets#425

**Full Changelog**:
https://github.com/ionic-team/stencil-ds-output-targets/compare/[@&#8203;stencil/angular-output-target](https://togithub.com/stencil/angular-output-target)[@&#8203;0](https://togithub.com/0).8.4...[@&#8203;stencil/vue-output-target](https://togithub.com/stencil/vue-output-target)[@&#8203;0](https://togithub.com/0).8.8

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "every weekday before 11am" (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ionic-team/ionic-framework).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

bug: Vue IonAccordionGroup takes value from underlying component
4 participants