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

Focus is lost when the hyperlink modal is cancelled #9970

Closed
geball opened this issue Feb 21, 2024 · 3 comments · Fixed by #10258
Closed

Focus is lost when the hyperlink modal is cancelled #9970

geball opened this issue Feb 21, 2024 · 3 comments · Fixed by #10258
Labels
bug It's a bug desktop All desktop platforms editor

Comments

@geball
Copy link

geball commented Feb 21, 2024

Operating system

Linux

Joplin version

2.13.15

Desktop version info

Joplin 2.13.15 (prod, linux)

Client ID: 59929b147fa5436cbc8a24035555730a
Sync Version: 3
Profile Version: 44
Keychain Supported: No

Current behaviour

  1. I open or create a note.

Screenshot showing the Joplin markdown editor and preview pane. There is an H1 that reads "A new note!" and the cursor is below it.

  1. I hit <Ctrl-K> to open the Insert Hyperlink modal. The field receives focus, as expected.

Screenshot of the Insert Hyperlink modal, with focus in the single field. There are OK and Cancel buttons in the bottom-right corner.

  1. If I enter a hyperlink and hit <Enter> or click OK, everything works fine. However, if I hit <Esc> or click Cancel, the pane loses focus. It seems Joplin is still in focus, since pressing <Alt> focuses the File menu, but I need to click back into the pane to start typing again. (I can also <Shift-Tab> 3 times or <Tab> 4 times to focus the Markdown pane again, in case that helps narrow down what's focuses after cancelling the modal. I've tried arrow keys, etc., but can't see where focus is going.)

Expected behaviour

Upon cancelling the hyperlink modal, I would expect to return to where the cursor was previously.

Logs

No response

@geball geball added the bug It's a bug label Feb 21, 2024
@personalizedrefrigerator personalizedrefrigerator added desktop All desktop platforms editor labels Feb 22, 2024
@danimnunes
Copy link
Contributor

Hello everyone,

I've come across this issue and I would like to take a shot at resolving it. I'll keep you all posted on my progress.

Copy link
Contributor

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

@github-actions github-actions bot added the stale An issue that hasn't been active for a while... label Mar 28, 2024
@geball
Copy link
Author

geball commented Mar 28, 2024

Re: bot reply, still an issue in 2.14.20.

@github-actions github-actions bot removed the stale An issue that hasn't been active for a while... label Mar 29, 2024
fabiogvdneto added a commit to fabiogvdneto/joplin that referenced this issue Apr 3, 2024
… is cancelled

When closing the hyperlink prompt dialog, either by clicking cancel or just
by pressing escape, the prompt function returns a promise that is never
resolved or rejected, hence not executing the following code which would
give back focus to the editor.

This behaviour happens because the smalltalk library checks for a cancel
option. If this option is false or undefined (which was always the case),
the promise that is returned is never cancelled/rejected. What I did was
set this option to true so that the promise can be rejected and therefore
continue the flow of execution.

Signed-off-by: Fabio Neto <fabiogvdneto@tecnico.ulisboa.pt>
laurent22 added a commit that referenced this issue Apr 10, 2024
…lled (#10258)

Signed-off-by: Fabio Neto <fabiogvdneto@tecnico.ulisboa.pt>
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug desktop All desktop platforms editor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants