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

Set focus to translation field on open from reading screen #379

Open
jzohrab opened this issue Mar 27, 2024 · 5 comments
Open

Set focus to translation field on open from reading screen #379

jzohrab opened this issue Mar 27, 2024 · 5 comments
Assignees
Labels
tweak Adjustment to the code -- not a new feature, just minor mods/tweaks

Comments

@jzohrab
Copy link
Collaborator

jzohrab commented Mar 27, 2024

On open from reading screen, the term is created, most natural thing would be to edit the translation. ref discord

@jzohrab jzohrab added tweak Adjustment to the code -- not a new feature, just minor mods/tweaks good first issue Good for newcomers labels Mar 27, 2024
@Jayanth-Parthsarathy
Copy link
Contributor

Hey @jzohrab I would like to work on this. Please assign this to me.

@Jayanth-Parthsarathy
Copy link
Contributor

Jayanth-Parthsarathy commented Apr 1, 2024

Would adding a autofocus attribute to the {form.translation} field in the term/_form.html be a good start? It seems to work when I click on any of the terms on the read page.

@jzohrab
Copy link
Collaborator Author

jzohrab commented Apr 3, 2024

Hi @Jayanth-Parthsarathy - thanks very much! (Sorry have been travelling and busy) Autofocus should only be set if the language and term are already set:

  • If the form is opened to create a new term and the language isn't set, focus should go there
  • if form is opened to create new and lang is set (b/c the user set the "current language" from home screen), focus goes to the term
  • if lang and term are set, it should go to the translation.

Makes sense?

@Jayanth-Parthsarathy
Copy link
Contributor

Understood, thanks for the clarification :)

@jzohrab
Copy link
Collaborator Author

jzohrab commented Apr 27, 2024

@Jayanth-Parthsarathy did this work in #390 but I disabled it -- it has the unfortunate side-effect of pulling focus from the reading pane, which is a hassle when I'm quickly moving from term to term using the cursor keys. Perhaps there's a way to set the focus in the translation field when the form first gets the focus, so that the reading pane keeps the focus.

@jzohrab jzohrab removed the good first issue Good for newcomers label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tweak Adjustment to the code -- not a new feature, just minor mods/tweaks
Projects
Status: No status
Development

No branches or pull requests

2 participants