Skip to content

Commit

Permalink
Merge pull request #108 from wethegit/bugfix/click-event-layering
Browse files Browse the repository at this point in the history
Fix: click event layering
  • Loading branch information
andrewrubin authored Sep 26, 2024
2 parents 2a9a648 + c48de0f commit 439ed2e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wethegit/preact-stickerbook",
"version": "4.0.4",
"version": "4.0.5",
"description": "Easily create collage apps that are accessible by default.",
"files": [
"dist/*"
Expand Down
6 changes: 3 additions & 3 deletions src/lib/sticker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ export function Sticker({
// This makes sure that when we click *through* the sticker we get the next one below instead of some random one in the stack.
elements.sort((a, b) => {
if (
a.classList.contains("Sticker__img") &&
b.classList.contains("Sticker__img")
a.classList.contains(styles.Sticker__img) &&
b.classList.contains(styles.Sticker__img)
) {
if (!a.parentNode?.parentElement || !b.parentNode?.parentElement)
return 0
Expand All @@ -419,7 +419,7 @@ export function Sticker({
// Loop through the elements. If it belongs to a sticker then create a pointer event and "click" that sticker
elements.forEach((element) => {
if (
element.classList.contains("Sticker__img") &&
element.classList.contains(styles.Sticker__img) &&
!element.classList.contains("Sticker--checking")
) {
// create a specific "pointerdown" event
Expand Down

0 comments on commit 439ed2e

Please sign in to comment.