Skip to content

Commit

Permalink
[storybook] fix events-shadowdom example for mouse canvas
Browse files Browse the repository at this point in the history
Put the mouse canvas on top with zIndex, and remove unecessary style
  • Loading branch information
sim51 committed Aug 23, 2024
1 parent d510b96 commit bda69c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 1 addition & 6 deletions packages/storybook/stories/events-shadowdom/index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
<style>
html,
body,
#storybook-root,
#sigma-container {
#storybook-root {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
font-family: sans-serif;
}
#sigma-container .sigma-mouse {
z-index: 100;
}
#sigma-logs {
position: absolute;
top:0;
max-height: 20%;
overflow: hidden;
}
#sigma-logs > div {
Expand Down
3 changes: 3 additions & 0 deletions packages/storybook/stories/events-shadowdom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export default () => {
},
});

// Put the mouse canvas on top, so events can be catched even if the logs container is in front
renderer.getCanvases().mouse.style.cssText = "z-index: 100; position: absolute";

const nodeEvents = [
"enterNode",
"leaveNode",
Expand Down

0 comments on commit bda69c9

Please sign in to comment.