Hi @docdunning,
Thanks a lot for using Block Lab, and for your kind words.
There isn’t anything that does that so far, but it’s an interesting idea.
What kind of field would this be? A text field?
And where would the suggestions be from?
Thanks, that’s an interesting idea.
Yes, I guess a text field is the most likely. In the past, I’ve used jQuery’s Autocomplete which can have an inline array of data suggestions, or an Ajax source, which is what I’ve more often done. Type in a few letters and it pops up a dropdown with matching items … I’m sure you know what I mean.
I tried to add some home-brewed JS to the post editor page, but of course, all of the blocks are added dynamically. That makes it rather more tricky to add the Autocomplete widget to the items. I think it would have to be added to the fields when they are added to the page.
I see that in your Pro version, there’s a “post” field type, which might have a similar sort of functionality, but I’m only using the free version at the moment.
Hi @docdunning,
That makes sense. I assume the ‘Select’ field wouldn’t be sufficient, you’ve probably considered that:
https://getblocklab.com/docs/fields/select/
I see that in your Pro version, there’s a “post” field type, which might have a similar sort of functionality, but I’m only using the free version at the moment.
🙂 Sorry, I think I can only mention the free version in this forum.
No problem, Ryan.
I’m using the “select” field for situations where there’s only a limited number of options (as in my other post re “get_terms”). In this case there are potentially hundreds of items to pick from, so an autocomplete/suggest would be good.
I did eventually manage to get an autocomplete working on the WP edit page in a block field, but the field only remembers the keystrokes I made, not the selection from the autocomplete dropdown (despite several attempts to trigger the change).
Oh well, I’ll just have to use a straight text box and put some validation on it in the preview template.
Hi @docdunning,
Thanks for describing your use case. That makes sense, I’ll keep that in mind as we keep adding features.
If we do add something like that, I’ll ping you on this topic.