Skip to content

Hashtag autocomplete keeps typed text even if selected hashtag starts with something else #37276

@scy

Description

@scy

Steps to reproduce the problem

  1. Start a new post.
  2. Enter #foo.
  3. Hashtag autocomplete should open a pop-up menu with several options.
  4. Choose one that does not start with #foo. For example, on my instance, suggestions are #foo, #FanFoo, #SBGGÄnderungsFoo and #foo_bar_baz. I've selected #FanFoo.

Expected behaviour

The #foo should've been replaced with #FanFoo.

Actual behaviour

Hashtag autocomplete replaced the #foo I've typed with #fooFoo.

Detailed description

This issue is split off from my comment in #37153.

Apparently, the idea is to always keep the text the user entered verbatim, which normally is a good thing. #36995 even made sure that the case of letters in the original input will be maintained. However, the implementation apparently didn't consider the case where the original input (here: #foo) and the selected hashtag (here: #FanFoo) do not start with the (case-insensitive) same substring.

Mastodon instance

chaos.social

Mastodon version

4.5.2, but also verified on a 4.5.3 instance

Browser name and version

Firefox 140.6.0esr (64-bit)

Operating system

Debian trixie

Technical details

No response

Metadata

Metadata

Assignees

Labels

area/web interfaceRelated to the Mastodon web interface

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions