Skip to content

Commit

Permalink
Fix displaying [Object object] in title
Browse files Browse the repository at this point in the history
when the title is not a string, the String(title) is [Object object]. Therefore, we shouldn't pass the title to "title" attribute if we can't convert it correctly

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en.
  • Loading branch information
chervyakovru authored Sep 13, 2023
1 parent 5b2ce45 commit f8e7a79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/AdaptiveTabs/AdaptiveTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ class Tab extends React.Component<TabProps> {

render() {
const {active, disabled, hint, title = this.props.id} = this.props;
const stringTitle = (hint || typeof title === 'string' ? title : '') as string;

Check failure on line 75 in src/components/AdaptiveTabs/AdaptiveTabs.tsx

View workflow job for this annotation

GitHub Actions / Verify Files

Delete `···`
return (
<div
className={b('tab', {active, disabled})}
title={String(hint || title || '')}
title={stringTitle}
onClick={disabled ? undefined : this.onClick}
>
{title}
Expand Down

0 comments on commit f8e7a79

Please sign in to comment.