1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-11-24 08:22:29 +02:00

Added tooltip text-wrap capability

This commit is contained in:
Harshil Sharma 2023-02-06 12:43:32 +05:30
parent ec6ea0497b
commit f9286dc53b
6 changed files with 22 additions and 6 deletions

View File

@ -45,8 +45,7 @@ const manifestStr = `
"type": "bool",
"help_text": "This allows board editors to share boards that can be accessed by anyone with the link.",
"placeholder": "",
"default": false,
"hosting": ""
"default": false
}
]
}

View File

@ -87,7 +87,7 @@ const initialValueCategoryValue: StatusCategory[] = [
color: '--sys-dnd-indicator-rgb',
text: {
id: 'statusProperty.configDialog.todo.emptyText',
defaultMessage: 'Drag statuses here to consider tasks with these statuses “Not Started”',
defaultMessage: 'Drag statuses here to\n consider tasks with these\n statuses “Not Started”',
},
},
},

View File

@ -53,6 +53,10 @@
background: rgba(var(--center-channel-color-rgb), 0.1);
}
}
.octo-tooltip.tooltip-bottom:hover::after {
width: 180px;
}
}
.categorySwimlane_ValueArea {

View File

@ -192,6 +192,8 @@ const EditStatusPropertyDialog = (props: Props): JSX.Element => {
id: valueCategory.emptyState.text.id,
defaultMessage: valueCategory.emptyState.text.defaultMessage,
})}
placement='bottom'
wrap={true}
>
<InfoIcon/>
</Tooltip>

View File

@ -47,10 +47,19 @@ $tooltop-vertical-offset: 2px;
position: relative;
// Arrow gets added before content
&:hover::before {
@extend %hover-tooltip-arrow; }
@extend %hover-tooltip-arrow;
}
// Tooltip message gets added after content
&:hover::after {
@extend %hover-tooltip-body; }
@extend %hover-tooltip-body;
}
&.wrap {
&:hover::after {
word-break: break-word;
white-space: unset;
}
}
// Top tooltip arrow style
&.tooltip-top:hover::before {

View File

@ -1,5 +1,6 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react'
import './tooltip.scss'
@ -8,6 +9,7 @@ type Props = {
title: string
children: React.ReactNode
placement?: 'top'|'left'|'right'|'bottom'
wrap?: boolean
}
// Adds tooltip div over children elements, the popup will
@ -15,7 +17,7 @@ type Props = {
// Default position is 'top'
function Tooltip(props: Props): JSX.Element {
const placement = props.placement || 'top'
const className = `octo-tooltip tooltip-${placement}`
const className = `octo-tooltip tooltip-${placement}${props.wrap ? ' wrap' : ''}`
return (
<div
className={className}