Setup
When creating a link
field and restricting it to only pages, like so:
link:
label: Link
type: link
options:
- page
Issue
The field looks as expected, however, when you click where it says “Select…”, you don’t get the dropdown of pages:
You have to click on “Page” and then select “Page” (the only option), from the dropdown, then the pages dropdown appears as expected:
Theory
It seems that “Page” isn’t actually selected, but is showing that it is, as it’s the only option. But there is visually no difference between the two states, so you would naturally expect the pages dropdown to appear.
Possible Solution
It looks like the issue is that the default “empty” option for the field is “Url”, even if “Url” isn’t an available option. So the solution could be to make the first option the default selected one, if the field is empty.
Currently, if you have the available options set to page
and then url
(in that order), it still defaults to Url
despite it being the 2nd option:
link:
label: Link
type: link
options:
- page
- url