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

[5.x] Fix link fieldtype state #10182

Merged
merged 2 commits into from
May 23, 2024
Merged

[5.x] Fix link fieldtype state #10182

merged 2 commits into from
May 23, 2024

Conversation

jasonvarga
Copy link
Member

@jasonvarga jasonvarga commented May 23, 2024

Fixes #9526

When the link fieldtype is created, it initializes its state from the metadata. (e.g. the dropdown option).

Fresh link fields have nulls in the meta data (the "None" option in the dropdown, for example).

When you switch into live preview, or a bard field gets saved, the components get recreated. Since it gets reinitialized from the meta, it'll reset various things and that's why you see the dropdown revert to "None".

This PR maintains the meta data appropriately.

The meta data is called initialThis, initialThat, etc and updating those is a little weird, but I don't want to get into renaming those right now.

@edalzell
Copy link
Contributor

@jasonvarga works perfect!

@jasonvarga jasonvarga merged commit f18fdf7 into 5.x May 23, 2024
15 checks passed
@jasonvarga jasonvarga deleted the link-fieldtype-fixes branch May 23, 2024 19:48
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.

Issue with link inside bard when using remove_empty_nodes: trim
2 participants