Skip to content

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

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

Activity

  1. yash113gadia commented on May 31, 2026

    @yash113gadia

    I'd like to work on this! The trailing space comes from the unconditional space in the template literal at line 219. I'll make it conditional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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