Skip to content

[Feature] Raw text support for TokenizingTextBox #3486

Closed
@huynhsontung

Description

@huynhsontung

Describe the problem this feature would solve

Currently, TokenizingTextBox only accepts tokens. It can be expanded to support raw text as well. With this addition, TokenizingTextBox can be used as chat box or comment box where mention feature is available.

Describe solution

The control will accept raw text like a regular TextBox. When a specified token opening signifier is matched (e.g. @ for mention), it will start suggesting token. Once the control starts suggesting, it only stops when:

  1. User selects a suggested token.
  2. No matching token is found. Adding more text won't produce a match. Current query is considered raw text.
  3. Another opening signifier is detected. Previous query is considered raw text. Start suggesting for the current query.

The control should also provide suggestions when the user go back and edit raw text. When editing, only the string between the signifier and the caret, not including whitespace, is queried.
For example, with | as caret position, Hello Miles Luna how are you? when change to:

  • Hello @|Miles Luna how are you? it will start suggesting from empty query.
  • Hello @Miles| Luna how are you? only Miles should be queried for suggestions. Token selection will replace Miles.
  • Hello @Miles L|una how are you? no suggestion as there is whitespace between Miles and L
Feature Priority
Get and set raw text Must
Change token opening signifier Must
Parse raw text to populate tokens Should
Support multiple signifiers at the same time (e.g. @ for mention, # for tag) Should
Support editing token's raw text representation (e.g. @Miles Luna can be shortened to @Miles while still being the same token) Should

Describe alternatives you've considered

  • AutoSuggestBox

Expected result

image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions