Skip to content

Commit

Permalink
fix: Typography error on context ellipsis (#33725)
Browse files Browse the repository at this point in the history
* chore: init measure

* chore: out of space

* refactor: Multiple render

* chore: auto cut

* feat: render split

* fix: ellipsis logic of suffix

* fix: ref missing

* fix: Tooltip missing

* test: snapshot

* chore: opt for textarea

* test: back part of ellipsis

* chore: back of ellipsis logic

* ellipsis logic

* fix: init ellipsis measure

* fix: ellipsis event

* chore: clean up

* test: Update snapshot

* fix: test

* test: Update snapshot

* chore: lazy ellipsis

* fix: check css ellipsis logic

* test: Update snapshot

* test: back of coverage

* chore: clean up

* test: ignore else

* test: clean up
  • Loading branch information
zombieJ committed Jan 18, 2022
1 parent 2ae15a6 commit 395c549
Show file tree
Hide file tree
Showing 17 changed files with 1,646 additions and 1,081 deletions.
34 changes: 34 additions & 0 deletions components/form/__tests__/__snapshots__/demo-extend.test.ts.snap
Expand Up @@ -2979,9 +2979,26 @@ exports[`renders ./components/form/demo/label-debug.md extend context correctly
title=""
>
<span
aria-label="longtextlongtextlongtextlongtextlongtextlongtextlongtext"
class="ant-typography ant-typography-ellipsis ant-typography-single-line"
>
longtextlongtextlongtextlongtextlongtextlongtextlongtext
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
>
lg
</span>
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:0;white-space:normal;margin:0;padding:0"
>
<span
aria-hidden="true"
>
...
</span>
</span>
</span>
</label>
</div>
Expand Down Expand Up @@ -3016,9 +3033,26 @@ exports[`renders ./components/form/demo/label-debug.md extend context correctly
title=""
>
<span
aria-label="longtext longtext longtext longtext longtext longtext longtext"
class="ant-typography ant-typography-ellipsis ant-typography-single-line"
>
longtext longtext longtext longtext longtext longtext longtext
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
>
lg
</span>
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:0;white-space:normal;margin:0;padding:0"
>
<span
aria-hidden="true"
>
...
</span>
</span>
</span>
</label>
</div>
Expand Down
34 changes: 34 additions & 0 deletions components/form/__tests__/__snapshots__/demo.test.js.snap
Expand Up @@ -2617,9 +2617,26 @@ exports[`renders ./components/form/demo/label-debug.md correctly 1`] = `
title=""
>
<span
aria-label="longtextlongtextlongtextlongtextlongtextlongtextlongtext"
class="ant-typography ant-typography-ellipsis ant-typography-single-line"
>
longtextlongtextlongtextlongtextlongtextlongtextlongtext
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
>
lg
</span>
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:0;white-space:normal;margin:0;padding:0"
>
<span
aria-hidden="true"
>
...
</span>
</span>
</span>
</label>
</div>
Expand Down Expand Up @@ -2654,9 +2671,26 @@ exports[`renders ./components/form/demo/label-debug.md correctly 1`] = `
title=""
>
<span
aria-label="longtext longtext longtext longtext longtext longtext longtext"
class="ant-typography ant-typography-ellipsis ant-typography-single-line"
>
longtext longtext longtext longtext longtext longtext longtext
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:9999px"
>
lg
</span>
<span
aria-hidden="true"
style="position:fixed;display:block;left:0;top:0;z-index:-9999;visibility:hidden;pointer-events:none;width:0;white-space:normal;margin:0;padding:0"
>
<span
aria-hidden="true"
>
...
</span>
</span>
</span>
</label>
</div>
Expand Down
7 changes: 6 additions & 1 deletion components/locale-provider/index.tsx
Expand Up @@ -31,7 +31,12 @@ export interface Locale {
global?: Record<string, any>;
PageHeader?: { back: string };
Icon?: Record<string, any>;
Text?: Record<string, any>;
Text?: {
edit?: any;
copy?: any;
copied?: any;
expand?: any;
};
Form?: {
optional?: string;
defaultValidateMessages: ValidateMessages;
Expand Down

0 comments on commit 395c549

Please sign in to comment.