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

Allow To Manually Select Input-field #2097

Closed
keeganedwin opened this issue Jul 25, 2023 · 2 comments · Fixed by #2199
Closed

Allow To Manually Select Input-field #2097

keeganedwin opened this issue Jul 25, 2023 · 2 comments · Fixed by #2199
Labels
bug Something isn't working

Comments

@keeganedwin
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
When editing a token, the user selects the value field to edit, but the plugin automatically selects (auto-focus) the name-field for the user to edit.

Key information:
User only seems to be facing this issue on a Windows system.

Describe the solution you'd like
Allow the user to select the field they want to edit.

Additional context
https://github.com/tokens-studio/figma-plugin/assets/93133012/84afa36b-de36-47dd-9b83-e340ad206ebf

@six7
Copy link
Collaborator

six7 commented Jul 26, 2023

Reason for that is likely the 50ms timeout we have on focusing the first input. I've never been able to work around that, but maybe someone else wants to pick that up.

setTimeout(() => {

@six7 six7 moved this from 📥 Triage to 📤 Ready for dev in Tokens Studio for Figma Roadmap Jul 26, 2023
@six7 six7 added the bug Something isn't working label Jul 26, 2023
six7 added a commit that referenced this issue Aug 30, 2023
Fixes #2031
Fixes #2097
Fixes #1799


This set of changes includes improvements to the user experience and
state management, as well as bug fixes. The `ConfirmDialog` and `Input`
components were updated to ensure immediate focus on the input element
after rendering. The `useTokens` module and `EditTokenForm` component
now store the last used update mode when renaming tokens, improving
state management and UI. Two bug fixes were also included, related to
issues when renaming tokens or token groups.

* `src/app/components/Input.tsx`: `setTimeout` function removed and
`focus()` called directly on `htmlInputRef.current` to ensure immediate
focus on input element after rendering. (F6c8a7b5L3)
* `src/app/components/ConfirmDialog.tsx`: Improved UX by focusing on
first input field after `ConfirmDialog` is shown by removing setTimeout
function and adding `firstInput` to useEffect dependencies in
`ConfirmDialog.tsx`. (F7d9e2c8L1)
* `src/app/store/useTokens.tsx`: Stores last used update mode when
renaming tokens and groups, and UI now defaults to last used update mode
instead of current mode. (F5a6b1e4L1)
* `src/app/components/EditTokenForm.tsx`: Stores last used update mode
when renaming tokens, ensuring it is selected by default instead of
current mode. Improves state management and UI. (F2b5c8f1L1)
* `.changeset/curly-ravens-prove.md` and
`.changeset/young-kangaroos-brake.md`: Updated
`@tokens-studio/figma-plugin` to fix bug causing issues when renaming
tokens or token groups. (Bug fixes)
@github-project-automation github-project-automation bot moved this from 📤 Ready for dev to ✅ Done in Tokens Studio for Figma Roadmap Aug 30, 2023
@six7
Copy link
Collaborator

six7 commented Aug 30, 2023

Shipped in 1.37.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants