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 slotted items being unclickable after update #2381

Merged
merged 1 commit into from
Jun 28, 2022

Conversation

MadsBuchmann
Copy link
Contributor

@MadsBuchmann MadsBuchmann commented Jun 28, 2022

Which issue does this PR close?

This PR closes #2153

What is the new behavior?

The issue was caused by the event listener being set up once using the renderer on afterContentChecked. If the slotted items changed, an if sentence caused the new items to not have their click listener set up. Now we do it everytime the kirbyItemsSlotted attribute is updated. We also make sure to unlisten old items when it changes & onDestroy.

Does this PR introduce a breaking change?

  • Yes
  • No

Checklist:

The following tasks should be carried out in sequence in order to follow the process of contributing correctly.

Reminders

  • Make sure you have implemented tests following the guidelines in: "The good: Test".
  • Make sure you have updated the cookbook with examples and showcases (for bug fixes, enhancements & new components).

Review

  • Do a self-review.
  • Request that the changes are code-reviewed
  • Request that the changes are UX reviewed (only necessary if your PR introduces visual changes)

When the pull request has been approved it will be merged to develop by Team Kirby.

Fixes #2153 - the issue was caused by the event listener being set up once using the renderer on afterContentChecked. If the slotted items changed an if sentence did so the new items did not have their click listener set up. Now we do it everytime the kirbyItemsSlotted attribute is updated. We also make sure to unlisten old items when it changes & onDestroy.
@MadsBuchmann MadsBuchmann changed the title 🐛 Fix slotted items being unclickable after update Fix slotted items being unclickable after they're updated Jun 28, 2022
@MadsBuchmann MadsBuchmann changed the title Fix slotted items being unclickable after they're updated Fix slotted items being unclickable after update Jun 28, 2022
@MadsBuchmann MadsBuchmann merged commit ef91e2c into develop Jun 28, 2022
@MadsBuchmann MadsBuchmann deleted the bug/2153-dropdown-custom-items branch June 28, 2022 10:54
This was referenced Aug 11, 2022
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] Dropdown breaks when changing custom items
2 participants