Lundalogik / lime-elements

Provides reusable web components for Lime CRM
https://lundalogik.github.io/lime-elements/versions/latest
Other
38 stars 12 forks source link

perf(dock): avoid re-creating observer whenever menu is opened #2982

Closed jgroth closed 1 month ago

jgroth commented 1 month ago

The intersection observer was re-created every time the button in the menu was clicked, causing the callback to be invoked multiple times

Review:

Browsers tested:

(Check any that applies, it's ok to leave boxes unchecked if testing something didn't seem relevant.)

Windows:

Linux:

macOS:

Mobile:

hannahu commented 1 month ago

Looks good! How can I test it?

jgroth commented 1 month ago

Looks good! How can I test it?

You can add a logpoint in the callback and see that it's only called once when a many is opened :upside_down_face: It will be invoked one more time for each time it's clicked without this fix

hannahu commented 1 month ago

Looks good! How can I test it?

You can add a logpoint in the callback and see that it's only called once when a many is opened 🙃 It will be invoked one more time for each time it's clicked without this fix

Yeah I was thinking if there was another way to test if it caused more trouble.

hannahu commented 1 month ago

Some docs are failing?

github-actions[bot] commented 1 month ago

Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-2982/

lime-opensource commented 1 month ago

:tada: This PR is included in version 37.40.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: