Skip to content

fix: update element ids when related props change#1656

Merged
silviuaavram merged 1 commit intodownshift-js:masterfrom
juzerzarif:fix/element-ids
Dec 2, 2025
Merged

fix: update element ids when related props change#1656
silviuaavram merged 1 commit intodownshift-js:masterfrom
juzerzarif:fix/element-ids

Conversation

@juzerzarif
Copy link
Contributor

What:
Fixes #1651.
Elements' id attributes in the markup stay in sync with the props when the props change during the lifecycle of the hook.

Why:
We used to memoize the element id props on the first render and then use those throughout the lifecycle of the component. This could cause ids in the markup to be out of sync from the ids provided via props.

How:
This change updates the internal element id getter references whenever any id related props change to propagate those props changes to the markup.

Checklist:

  • Documentation - N/A
  • Tests
  • TypeScript Types - N/A
  • Flow Types - N/A
  • Ready to be merged

@juzerzarif
Copy link
Contributor Author

@silviuaavram - just pinging you for review whenever you get the time, sorry this took so long to put up 😅

@silviuaavram silviuaavram self-requested a review October 9, 2025 14:06
@silviuaavram
Copy link
Collaborator

@juzerzarif could you rebase and push again, please? not sure why CI does not kick in

We used to memoize the element id props on the first render and then use
those throughout the lifecycle of the component. This could cause ids in
the markup to be out of sync from the ids provided via props. This
change updates the internal element id getter references whenever any id
related props change to propagate those props changes to the markup.
@juzerzarif
Copy link
Contributor Author

@juzerzarif could you rebase and push again, please? not sure why CI does not kick in

@silviuaavram rebased. Looks like the workflow needs maintainer approval to run.

@silviuaavram silviuaavram merged commit c2f79b4 into downshift-js:master Dec 2, 2025
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

🎉 This PR is included in version 9.0.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Element IDs do not update on re-renders

2 participants