Skip to content
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

fix: fix keyboard controls with carousel #925

Merged
merged 1 commit into from
Mar 9, 2024
Merged

Conversation

mscolnick
Copy link
Contributor

@mscolnick mscolnick commented Mar 9, 2024

  • only use keyboard nav in fullscreen
  • prevent keypresses while inside components (e.g. mo.ui.code_editor) from moving the carousel

Fixes #923

Copy link

vercel bot commented Mar 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 9, 2024 0:39am
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 9, 2024 0:39am

akshayka
akshayka previously approved these changes Mar 9, 2024
Comment on lines +107 to +115
onKeyDown={(e) => {
// If the target is from a marimo element, stop propagation
if (
e.target instanceof HTMLElement &&
e.target.tagName.toLocaleLowerCase().startsWith("marimo-")
) {
e.stopPropagation();
}
}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we do this with onMouseDown too and then re-enable simulateTouch=True?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just tried - got pretty close. it works with sliders, but not with altair, so lets just keep it off

@mscolnick mscolnick merged commit 8fbda0d into main Mar 9, 2024
29 checks passed
@mscolnick mscolnick deleted the ms/fix-carousel-keyboard branch March 9, 2024 00:44
@github-actions github-actions bot locked and limited conversation to collaborators Mar 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arrows spin the carousel when trying to move cursor inside mo.ui.code_editor()
2 participants