fix(ui): correct text orientation for CJK characters in collapsible column (#619)
This commit is contained in:
parent
cfdf1bd903
commit
a25a10f7e8
1 changed files with 3 additions and 1 deletions
|
|
@ -21,6 +21,8 @@ export function CollapsibleColumn({
|
||||||
collapsedLabel,
|
collapsedLabel,
|
||||||
children,
|
children,
|
||||||
}: CollapsibleColumnProps) {
|
}: CollapsibleColumnProps) {
|
||||||
|
const isCJK = /[\u4e00-\u9fa5\u3040-\u30ff\uac00-\ud7af]/.test(collapsedLabel);
|
||||||
|
|
||||||
if (isCollapsed) {
|
if (isCollapsed) {
|
||||||
return (
|
return (
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
|
|
@ -42,7 +44,7 @@ export function CollapsibleColumn({
|
||||||
<CollapsedIcon className="h-5 w-5 text-muted-foreground group-hover:text-foreground transition-colors flex-shrink-0" />
|
<CollapsedIcon className="h-5 w-5 text-muted-foreground group-hover:text-foreground transition-colors flex-shrink-0" />
|
||||||
<div
|
<div
|
||||||
className="text-xs font-medium text-muted-foreground group-hover:text-foreground transition-colors whitespace-nowrap"
|
className="text-xs font-medium text-muted-foreground group-hover:text-foreground transition-colors whitespace-nowrap"
|
||||||
style={{ writingMode: 'vertical-rl', transform: 'rotate(180deg)', textOrientation: 'mixed' }}
|
style={{ writingMode: 'vertical-rl', transform: isCJK ? 'none' : 'rotate(180deg)', textOrientation: 'mixed' }}
|
||||||
>
|
>
|
||||||
{collapsedLabel}
|
{collapsedLabel}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue