Skip to content

Commit

Permalink
🐛 fix(PageStack): closest element may not exists when touching (#2267)
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem authored Nov 29, 2024
1 parent 7043924 commit ba7f4df
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/Masa.Blazor.JS/src/components/page-stack/touch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ export function useTouch(
}

function isActiveElement(e: TouchEvent) {
return (
(e.target as HTMLElement).closest(".m-page-stack-item").parentElement ===
el
);
const pageStackItem = (e.target as HTMLElement).closest(".m-page-stack-item");
return pageStackItem && pageStackItem.parentElement === el;
}

function onTouchstart(e: TouchEvent) {
Expand Down
2 changes: 1 addition & 1 deletion src/Masa.Blazor/wwwroot/js/components/page-stack/touch.js

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

Loading

0 comments on commit ba7f4df

Please sign in to comment.