-
-
Notifications
You must be signed in to change notification settings - Fork 196
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 rename/updatemode and input issues #2199
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@tokens-studio/figma-plugin': patch | ||
--- | ||
|
||
Fixes an issue where renaming a token or token group would cause `Apply to` to be changed |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@tokens-studio/figma-plugin': patch | ||
--- | ||
|
||
Fixes an issue where the choice of `Rename styles` was not remembered per session |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@tokens-studio/figma-plugin': patch | ||
--- | ||
|
||
Fixes an issue with token edit inputs being focused after a timeout |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,7 +1,9 @@ | ||||||
import React from 'react'; | ||||||
import { useSelector } from 'react-redux'; | ||||||
import { SingleToken } from '@/types/tokens'; | ||||||
import Tooltip from '../Tooltip'; | ||||||
import { TokenTooltipContent } from './TokenTooltipContent'; | ||||||
import { showEditFormSelector } from '@/selectors'; | ||||||
|
||||||
type Props = { | ||||||
token: SingleToken; | ||||||
|
@@ -11,14 +13,17 @@ export const TokenTooltip: React.FC<Props> = ({ | |||||
children, | ||||||
token, | ||||||
}) => { | ||||||
// When we open the token edit form we don't want tooltips to show through, which is happening sometimes | ||||||
const showEditForm = useSelector(showEditFormSelector); | ||||||
|
||||||
if (!children || !React.isValidElement(children)) { | ||||||
return null; | ||||||
} | ||||||
|
||||||
return ( | ||||||
<Tooltip | ||||||
side="bottom" | ||||||
label={( | ||||||
label={showEditForm ? '' : ( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wouldn't it be better to add the condition above and just return null when the editForm is visible ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that would cause the children to also not be rendered though (Tooltip wraps the token button) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah got it. then the best way would be something like if (showEditForm) return children There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll include that in a followup 👍 |
||||||
<TokenTooltipContent | ||||||
token={token} | ||||||
/> | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as further down, that would cause jumps in layout as the button would not be rendered anymore. we just dont want the tooltip to be renderd