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

FR: Use autosuggest component for template selection #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tomkiss
Copy link

@tomkiss tomkiss commented Sep 13, 2023

This fork changes the plugins form element to use the autosuggest component, which improves template selection through the improved UI.

@sjelfull
Copy link
Owner

@tomkiss Thanks for this PR! I didn't actually notice it until I did a major change where I added support for "beautifying" the paths and file names in the template select input.

Do you know if the autosuggest field has a way to control the rendering of the value?

@sjelfull sjelfull self-requested a review May 12, 2024 20:14
@tomkiss
Copy link
Author

tomkiss commented May 13, 2024

Hi @sjelfull,

You can't really style as such, but you can provide a "hint" that will render in the field.

For example, when rendering a field normally, you can send it something like this:

  'data' => ['Domestic Cat', 'Leopard', 'Lion']

But, you could use the hint property to improve what's displayed. Like so:

  'data' => [
      [
          'name' => 'Domestic Cat',
          'hint' => 'Your friend at home',
      ],
      [
          'name' => 'Leopard',
          'hint' => 'Classic Apple operating system',
      ],
      [
          'name' => 'Lion',
          'hint' => 'MGM',
      ]
  ]

...which would result in a UI that renders something like this:

Screenshot 2024-05-13 at 13 41 15

So, you could lead with the template name, then hint the full path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants