Skip to content

bug: Tooltip shows trailing space for formatters without keyboard shortcut #1280

@deepak0x

Description

@deepak0x

Description

Template literal always inserts a space between item.name and the shortcut expression, even when shortcut is empty string

Steps to reproduce

  1. Open packages/react/src/views/ChatInput/ChatInputFormattingToolbar.js around line 219
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions