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

fix: Balloon のコンテンツを折り返すように修正する #4706

Closed
wants to merge 7 commits into from

Conversation

s-sasaki-0529
Copy link
Contributor

@s-sasaki-0529 s-sasaki-0529 commented Jun 7, 2024

Related URL

https://smarthr.atlassian.net/browse/SHRUI-984

Overview

<Balloon> コンポーネントにて、ラベルがスペースを含まない半角文字列の場合に、親コンテナを溢れて横スクロールが発生することがあり、これが WCAG 1.4.10 リフロー (レベル AA) に違反するため修正する。

What I did

常に折り返せるようにスタイルを修正

Capture

before
CleanShot 2024-06-12 at 20 26 55

after
CleanShot 2024-06-12 at 20 27 20

@@ -14,7 +14,7 @@ const balloon = tv({
'shr-drop-shadow-[0_2px_2.5px_theme(colors.transparency.30)]',
// Safariでdrop-shadowが残り続けてしまうバグの対応
'shr-will-change-[filter]',
'shr-whitespace-nowrap',
'shr-break-all',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all は単語境界以外でも折り返しちゃうから強すぎるかも…?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この方針で良ければ同様の事象が発生する <Button> <StatusLabel> も対応します。

@@ -14,7 +14,6 @@ const balloon = tv({
'shr-drop-shadow-[0_2px_2.5px_theme(colors.transparency.30)]',
// Safariでdrop-shadowが残り続けてしまうバグの対応
'shr-will-change-[filter]',
'shr-whitespace-nowrap',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

とりあえず nowrap 消しだだけ。
けどあえて折り返さないようにした意図がある気もしました。問題なければ同様の対応を Button StatusLabel にも行いたいですがどうですかね。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nowrapを指定しないと親要素の横幅に依存してしまうので設定していたような記憶...
消すの難しいかも?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありそうだなと思いつつどういう実害があるか再現せず…。
Tooltip の場合は Balloon は Portal化されるから親要素のサイズに依存しないんですかね。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あー、balloonを直接利用するパターンって実質存在していないのか...
この修正いれる際に各プロダクトのballoon -> tooltip を促すためにexport調整しても言いかも?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TooltipPortalの意図を聞かないとわからなさそうですね〜

@s-sasaki-0529 s-sasaki-0529 marked this pull request as ready for review June 7, 2024 03:47
@s-sasaki-0529 s-sasaki-0529 requested a review from a team as a code owner June 7, 2024 03:47
@s-sasaki-0529 s-sasaki-0529 requested review from AtsushiM and Qs-F and removed request for a team June 7, 2024 03:47
@s-sasaki-0529 s-sasaki-0529 self-assigned this Jun 12, 2024
@s-sasaki-0529
Copy link
Contributor Author

すぐ手は出せなそうなのと、あるべき姿が不明瞭なので一旦閉じます 🙏

@s-sasaki-0529 s-sasaki-0529 deleted the SHRUI-941-SHRUI-984 branch June 18, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants