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: event bubbling wrong when clicking on month day event #216

Merged
merged 2 commits into from
Dec 1, 2023
Merged

fix: event bubbling wrong when clicking on month day event #216

merged 2 commits into from
Dec 1, 2023

Conversation

MarcelR1998
Copy link
Contributor

@MarcelR1998 MarcelR1998 commented Dec 1, 2023

Checklist

Please put "X" in the below checkboxes that apply::

  • If committing a bugfix, I have tested it in different browsers (Chrome, Firefox, Safari).
  • If committing a new feature, I have first submitted an issue (Please note: you are free to open PRs for non-issued features, but opening an issue increases your chance of a successful PR).
  • If committing a new feature, I have also written an appropriate test suite for it.

I have tested the following:

  • Qalendar component in month mode.
  • Qalendar component in week mode.
  • Qalendar component in day mode.
  • All of the above modes on emulated mobile view.
  • Dragging and dropping events.
  • Resizing events in day/week modes.
  • Clicking events to open event dialog.

This PR solves the following problem**.

Prevents the date-was-clicked event from bubbling up when an event is clicked.
I saw that the .self modifier was removed 6 months ago on that exact line, maybe there is some reason for this? Otherwise, I tested adding .stop on the @click on the event in the month view, which also seems to work.

I saw the unit test comment saying there is a problem testing click events with .self? Would writing a unit test testing .stop work?

How to test this PR**.

For example:

  1. Click event in month, check for propagation of date-was-clicked event

@coveralls
Copy link

coveralls commented Dec 1, 2023

Coverage Status

coverage: 97.265% (-0.3%) from 97.607%
when pulling 4ff82ad on MarcelR1998:master
into f1ae1dd on tomosterlund:master.

Copy link
Owner

@tomosterlund tomosterlund left a comment

Choose a reason for hiding this comment

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

Looks good to me. I think it would also be good to cover this in a unit test for Day.vue, where we click an event, and then check that only event-was-clicked was emitted and not additionally date-was-clicked. If you want to add it, feel free, otherwise I could also give it a shot later today 😊

@@ -9,7 +9,7 @@
'is-selected': isSelected,
'is-today': isToday,
}"
@click="emitDayWasClicked"
@click.self="emitDayWasClicked"
Copy link
Owner

Choose a reason for hiding this comment

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

👍

@tomosterlund tomosterlund merged commit ca95519 into tomosterlund:master Dec 1, 2023
7 of 8 checks passed
@felix-berlin
Copy link
Collaborator

🎉 This PR is included in version 3.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants