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(Tooltip): break word in title and description #8101

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/vkui/src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export type TooltipOnShownChange = OnShownChange;
export interface TooltipProps extends AllowedFloatingComponentProps, AllowedTooltipBaseProps {
/**
* Передача `boolean` позволяет контролировать состояния показа и скрытия вручную. Используйте
* совместно с `onShawnChange`.
* совместно с `onShownChange`.
*
* > Если нужно разово инициировать показ тултипа при первом рендере, то используйте `defaultShown`.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
background: none;
}

.title,
.description {
word-break: break-word;
}

.arrow {
color: var(--vkui--color_background_contrast_themed);
}
Expand Down
10 changes: 8 additions & 2 deletions packages/vkui/src/components/TooltipBase/TooltipBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,14 @@ export const TooltipBase = ({
)}
<div className={styles.content} style={maxWidth !== null ? { maxWidth } : undefined}>
<div>
{hasReactNode(title) && <Subhead weight="2">{title}</Subhead>}
{hasReactNode(description) && <Subhead>{description}</Subhead>}
{hasReactNode(title) && (
<Subhead className={styles.title} weight="2">
{title}
</Subhead>
)}
{hasReactNode(description) && (
<Subhead className={styles.description}>{description}</Subhead>
)}
</div>
{typeof onCloseIconClick === 'function' && (
<Tappable
Expand Down
Loading