Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Pattern input field (the alternative version) #17634

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

brunopagno
Copy link
Contributor

@brunopagno brunopagno commented Jan 16, 2025

Ticket

https://community.openproject.org/projects/document-workflows-stream/work_packages/59999

Strongly related to #17472

What are you trying to accomplish?

Screenshots

Not final version, just a proposal

Screencast.From.2025-01-16.16-08-51.mp4

What approach did you choose and why?

The difference of this approach is that it behaves even more like a text editor with an autocomplete (e.g. code editor) than a legitimate autocomplete field.

  • Custom UI for the autocomplete list
  • Tokens are editable and do self validation if they are representative of a valid value or not

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

This commit introduces a new type of input field which can handle autocomplete with 'tokens', so that we can build
patterns like `Example pattern {{token}} value`.
The idea of this change is to make the browser behaviour closer to the default. So the content editable allows anything
inside it to be editable. Some mouse events were removed as well.

In the end the input is behaving more as a text editor than a autocomplete input.
@brunopagno brunopagno self-assigned this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant