Skip to content

Commit 8513cd9

Browse files
authored
fix(comp:text): native tooltip should show when not ellipsised (#1709)
1 parent 5afea2f commit 8513cd9

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

packages/components/text/__tests__/__snapshots__/text.spec.ts.snap

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ exports[`Text > tag work 2`] = `
103103
`;
104104
105105
exports[`Text > tooltip work 1`] = `
106-
"<div class=\\"ix-text\\"><span class=\\"ix-text-inner\\" title=\\"@idux 是一套企业级中后台 UI 组件库, 致力于提供高效愉悦的开发体验。 基于 Vue 3.x + TypeScript 开发,
107-
全部代码开源并遵循 MIT 协议,任何企业、组织及个人均可免费使用。\\">@idux 是一套企业级中后台 UI 组件库, 致力于提供高效愉悦的开发体验。 基于 Vue 3.x + TypeScript 开发,
106+
"<div class=\\"ix-text\\"><span class=\\"ix-text-inner\\">@idux 是一套企业级中后台 UI 组件库, 致力于提供高效愉悦的开发体验。 基于 Vue 3.x + TypeScript 开发,
108107
全部代码开源并遵循 MIT 协议,任何企业、组织及个人均可免费使用。<!----></span>
109108
<!---->
110109
<!---->

packages/components/text/demo/Tooltip.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<IxRadioGroup v-model:value="tooltip" :dataSource="radios"></IxRadioGroup>
33
<div style="width: 280px; margin-top: 16px">
4-
<IxText :tooltip="tooltip">
4+
<IxText ellipsis :tooltip="tooltip">
55
@idux是一套企业级中后台UI组件库, 致力于提供高效愉悦的开发体验。
66
<template #title>
77
@idux是一套企业级中后台UI组件库, 致力于提供高效愉悦的开发体验。

packages/components/text/src/Text.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export default defineComponent({
128128
<Tag
129129
ref={innerRef}
130130
class={`${prefixCls}-inner`}
131-
title={isNative ? getStringBySlot(titleSlot) : undefined}
131+
title={isNative && isEllipsis.value ? getStringBySlot(titleSlot) : undefined}
132132
onClick={expandable.value && !hasExpandIcon ? toggleExpanded : undefined}
133133
{...attrs}
134134
>

0 commit comments

Comments
 (0)