Account: don't calculate max-width unnecessarily
This commit is contained in:
parent
ab8d162f03
commit
a433d22ba3
|
@ -165,7 +165,9 @@ const Account = ({
|
||||||
const actionWidth = actionRef.current?.clientWidth || 0;
|
const actionWidth = actionRef.current?.clientWidth || 0;
|
||||||
|
|
||||||
if (overflowRef.current) {
|
if (overflowRef.current) {
|
||||||
|
if (action && withRelationship && typeof overflowRef.current.style.maxWidth !== 'number') {
|
||||||
style.maxWidth = Math.max(0, overflowRef.current.clientWidth - 30 - avatarSize - actionWidth);
|
style.maxWidth = Math.max(0, overflowRef.current.clientWidth - 30 - avatarSize - actionWidth);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
style.visibility = 'hidden';
|
style.visibility = 'hidden';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue