Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

I want to implement an "async select" form element, where values are fetched from the server. Ideally, I'd rather not have to implement an API, but instead update the select DOM with unpoly directly.

Here's an example of what I'm talking about: https://druids.datadoghq.com/components/form/Select#async

I'm not sure what's the right way to implement this with unpoly. I'm thinking about using [up-validate] / [up-watch-event='input'], but I want to make sure this is the proper way of doing it!

You must be logged in to vote

Replies: 1 comment

Comment options

I would use [up-validate] as you've already considered. You could then look at X-Up-Validate to determine the target and necessary response.

Your example is an interesting one because it's kind of a hybrid element, perhaps closer to an <input> paired with a <datalist>. In that case, you could [up-validate] on the <input> with the <datalist> as a target posisbly.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.