-
Notifications
You must be signed in to change notification settings - Fork 4
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
adjust touch logic for non-interactive images #55
Conversation
CanvasPanel can use a static renderer, but set interactive to `false`. This works _ok_ in many cases, but falls down in a few. This allows us to adjust the interactivity from the css level by moving the pointer-events logic into it’s own css class that’s assigned based on the interactive prop
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
let isInteractive = true; | ||
// if we have a render preset and that render preset sets interactive to false, then... disable it | ||
if (renderPreset && Array.isArray(renderPreset) && renderPreset.length > 1 && (renderPreset[1] as any).interactive === false) { | ||
isInteractive = false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a logical assumption, by default it's interactive, but if someone explicitly sets the presets to disable the interactivity, then it isn't
This PR is dependent on atlas-viewer/atlas#55, and aims to demonstrate that setting interactive=false in CanvasPanel disables the mousewheel and touch interactions
This makes a lot of sense to me, being a bit more selective of where I noticed that |
.atlas-overlay { position: absolute; top: 0; left: 0; none; overflow: hidden; } | ||
/** setting the pointer events to none means that Atlas will own the touch and mousewheel events **/ | ||
.atlas-overlay--interactive { pointer-events: none; } | ||
.atlas-static-image { position: absolute; user-select: none; transform-origin: 0px 0px; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure where best to test this, but removing it didn't seem to change any of the stories
One thing to test might be the box-resizing on the homepage annotations story. I think that uses Changes look good, I think I've confused things by using the word |
@stephenwf So... the homepage renderer story gets at the core of the question, good point -- should we assume that if the |
… touch_adjustment_static
I think the changes to the static preset (from the storybook) are fine. I don't know of any uses of the static preset + annotations. Are you happy for me to merge and release? |
Hi Stephen, yes please & thank you! |
|
CanvasPanel can use a static-preset, but set interactive to
false
. This works ok in many cases, but falls down in a few. This allows us to adjust the interactivity from the css level by moving the pointer-events logic into it’s own css class that’s assigned based on the interactive prop