Skip to content

Commit

Permalink
fix: 不要なコードの削除
Browse files Browse the repository at this point in the history
  • Loading branch information
daiHash committed Nov 13, 2024
1 parent b680f29 commit bf16a17
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/smarthr-ui/src/components/Textarea/Textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ const textarea = tv({
],
counter: 'smarthr-ui-Textarea-counter shr-block shr-text-sm',
counterText: 'shr-text-black',
srOnlyNotice: 'shr-sr-only',
},
variants: {
error: {
Expand Down Expand Up @@ -234,15 +233,14 @@ export const Textarea = forwardRef<HTMLTextAreaElement, Props & ElementProps>(
[autoResize, lineHeight.normal, maxRows, onInput, rows],
)
const { textareaStyleProps, counterStyle, counterTextStyle } = useMemo(() => {
const { textareaEl, counter, counterText, srOnlyNotice } = textarea()
const { textareaEl, counter, counterText } = textarea()
return {
textareaStyleProps: {
className: textareaEl({ className }),
style: { width: typeof width === 'number' ? `${width}px` : width },
},
counterStyle: counter(),
counterTextStyle: counterText({ error: !!(maxLetters && maxLetters - count < 0) }),
srOnlyNoticeStyle: srOnlyNotice(),
}
}, [className, count, maxLetters, width])

Expand Down Expand Up @@ -274,9 +272,7 @@ export const Textarea = forwardRef<HTMLTextAreaElement, Props & ElementProps>(
</span>
</span>

<VisuallyHiddenText aria-live="polite" aria-atomic={true}>
{srCounterMessage}
</VisuallyHiddenText>
<VisuallyHiddenText aria-live="polite">{srCounterMessage}</VisuallyHiddenText>
<VisuallyHiddenText id={maxLettersNoticeId}>
こちらは文字カウンター付きの入力欄です。最大{maxLetters}文字まで入力できます。
</VisuallyHiddenText>
Expand Down

0 comments on commit bf16a17

Please sign in to comment.