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
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ export const All: StoryFn = () => (
<Txt>middle right</Txt>
</Balloon>
</li>
<li>
<Balloon horizontal="left" vertical="middle">
<Txt>{'long text '.repeat(30)} </Txt>
</Balloon>
<Balloon horizontal="right" vertical="middle">
<Txt>{'longext'.repeat(30)} </Txt>
</Balloon>
</li>
</List>
)
All.storyName = 'all'
Expand Down
2 changes: 1 addition & 1 deletion packages/smarthr-ui/src/components/Balloon/Balloon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
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の意図を聞かないとわからなさそうですね〜

'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> も対応します。

'shr-bg-white',
'shr-text-black',
'after:shr-block',
Expand Down