Description
Template literal always inserts a space between item.name and the shortcut expression, even when shortcut is empty string
Steps to reproduce
- Open
packages/react/src/views/ChatInput/ChatInputFormattingToolbar.js around line 219
- Tooltip text for 'strike', 'code', and 'multiline' renders as 'strike ', 'code ', 'multiline ' (with trailing space) instead of the bare name
Expected behavior
item.shortcut && (${item.shortcut}) evaluates to '' (empty string) when shortcut is '', but the space separator ${...} is unconditionally included in the template literal, producing a trailing space should be handled correctly.
Actual behavior
Tooltip text for 'strike', 'code', and 'multiline' renders as 'strike ', 'code ', 'multiline ' (with trailing space) instead of the bare name
Description
Template literal always inserts a space between item.name and the shortcut expression, even when shortcut is empty string
Steps to reproduce
packages/react/src/views/ChatInput/ChatInputFormattingToolbar.jsaround line 219Expected behavior
item.shortcut &&
(${item.shortcut})evaluates to '' (empty string) when shortcut is '', but the space separator${...}is unconditionally included in the template literal, producing a trailing space should be handled correctly.Actual behavior
Tooltip text for 'strike', 'code', and 'multiline' renders as 'strike ', 'code ', 'multiline ' (with trailing space) instead of the bare name