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

Keyboard Shortcuts for LineEdit not usable in Browsers on Mac OS #7477

Open
floers opened this issue Jan 27, 2025 · 4 comments
Open

Keyboard Shortcuts for LineEdit not usable in Browsers on Mac OS #7477

floers opened this issue Jan 27, 2025 · 4 comments
Labels
a:platform-macos Issues specific to macOS (mS,bF) a:platform-wasm browser integration (mO,bT) bug Something isn't working need triaging Issue that the owner of the area still need to triage

Comments

@floers
Copy link

floers commented Jan 27, 2025

Bug Description

On Mac OS it does not work properly to copy/paste/cut (via CMD+C, CMD+V, CMD+X) into and from LineEdit components.

This is reproducible via the gallery web example:
https://snapshots.slint.dev/master/demos/gallery/

We tested it with Chrome.

Reproducible Code (if applicable)

import { LineEdit } from "std-widgets.slint";

export component MyWindow inherits Window {
  LineEdit { }
}

Environment Details

  • Slint Version: 1.9.2
  • Platform/OS: Mac OS, Chrome
  • Programming Language: Rust
  • Backend/Renderer: WASM build so I think it's winit/software?

Product Impact

We want to create a small login form and utility web app with slint. With this bug it is completely unusable because we need the user to paste values into the LineEdits.

@floers floers added bug Something isn't working need triaging Issue that the owner of the area still need to triage labels Jan 27, 2025
@floers floers changed the title Keyboard Shortcuts for LineEdit not usable in Browsers Keyboard Shortcuts for LineEdit not usable in Browsers on Mac OS Jan 27, 2025
@ogoffart
Copy link
Member

Works for me with firefox and chromium under Linux.

@tronical could it be a problem because of the ctrl/cmd mapping not working properly on the browser?

@floers
Copy link
Author

floers commented Jan 27, 2025

using CMD+V prepends a 'v':

Screen.Recording.2025-01-27.at.12.27.00.mov

CMD+A does not work at all:

Screen.Recording.2025-01-27.at.12.27.11.mov

Select all from curser to left (CMD+Left) selects only one char:

Screen.Recording.2025-01-27.at.12.27.21.mov

Cut via CMD+X leaves an x behind:

Screen.Recording.2025-01-27.at.12.27.31.mov

@floers
Copy link
Author

floers commented Jan 27, 2025

For me it works as well on Linux. My collegues have Mac OS and we just found out.

@ogoffart ogoffart added a:platform-wasm browser integration (mO,bT) a:platform-macos Issues specific to macOS (mS,bF) labels Jan 27, 2025
@ogoffart
Copy link
Member

I have a suspicion that this is because we use 'CTRL' for shortcut on most platform, only for mac we map that to CMD. We do use cfg!(target_os = "macos") in a few places. But of course that doesn't work on wasm. We'd need a runtime browser check instead.
This is just a theory, I haven't tried on mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:platform-macos Issues specific to macOS (mS,bF) a:platform-wasm browser integration (mO,bT) bug Something isn't working need triaging Issue that the owner of the area still need to triage
Projects
None yet
Development

No branches or pull requests

2 participants