twitch icon indicating copy to clipboard operation
twitch copied to clipboard

FormTokenField cannot have identical names in value.

Open anwas opened this issue 2 years ago • 1 comments

Describe the issue your running into with your code

Description of the "Post Picker" block concept

The purpose of the "Post Picker" block is to replicate the "Relationship" Field Type of the ACF Pro plug-in.

Currently I have developed the ability to select records of a given post type by title using the "FormTokenField" component.

The elements in the suggestion list of the "FormTokenField" component must be unique. Unfortunately, sometimes a website may contain entries with identical titles and then the suggestion and value list of the "FormTokenField" component will not work. I have created a workaround for this limitation: https://github.com/whatever-for-ever/wordpress-development/blob/341889b1a5e7218907f3ce58419bbf76b109b42a/wp-content/plugins/an-whatever/_src/blocks/post-picker/edit.js#LL87C6-L118C8

Given this limitation, it is necessary to see if the "FormTokenField" component is a suitable choice for the "Post Picker" block.

In order to make the "Post Picker" block fully functional, help is needed for the following tasks:

  • [ ] create a taxonomy selection filter
  • [ ] create a record type selection filter
  • [ ] create the ability to reorder the selected records (this is a very high priority task)
  • [ ] according to the previous tasks, we need to see if it is possible to achieve this functionality using the 'FormTokenField' component. If it is not possible, an alternative must be found

Examples

ACF Pro "Relationship" Field Type

image

Current implementation achieved

image

Desired result

If the above tasks could be achieved, the ACF Pro plugin would no longer be needed in many places. I hope that with your help we can achieve the desired result.

Notice. I have edited this Issue because I have cleaned up the problem. Do apologize for the text errors as my English is not as good as I wish

Link to where I can see the code ( gist, repo, etc )

https://github.com/whatever-for-ever/wordpress-development/tree/341889b1a5e7218907f3ce58419bbf76b109b42a/wp-content/plugins/an-whatever/_src/blocks/post-picker

anwas avatar Mar 16 '23 15:03 anwas

Done!

ryanwelcher avatar Mar 30 '23 16:03 ryanwelcher