bug: Tooltip shows trailing space for formatters without keyboard shortcut

Open Beginner friendly
#1,280 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
javascript, react
Domain
frontend

Research direction

Start in packages/react/src/views/ChatInput/ChatInputFormattingToolbar.js around line 219, where the tooltip text for formatting items is assembled. Check the output for strike, code, and multiline with empty shortcuts; done means each shows only its bare name without a trailing space, while items with shortcuts retain their shortcut text.

Written by the indexing model from the issue text.

Description

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

Dominant language
JavaScript
Stars
165
Forks
381
Avg merge
1d 2h
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RocketChat/EmbeddedChat

All issues in RocketChat/EmbeddedChat

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.