Skip to content

Conversation

@probably-neb
Copy link
Collaborator

Closes #41533

Both of the issues in the release notes that are fixed in this PR, were caused by incorrect usage of the window.use_state API.
The first issue was caused by calling window.use_state in a render helper, resulting in the element ID used to share state being the same across different pages, resulting in the state being re-used when it should have been re-created. The fix for this was to move the window.state (and rendering logic) into a impl RenderOnce component, so that the IDs are resolved during the render, avoiding the state conflicts.

The second issue is caused by using a move closure in the window.use_state call, resulting in stale closure values when the window state is re-used.

Release Notes:

  • settings_ui: Fixed an issue where some dropdown menus would show options from a different dropdown when clicked
  • settings_ui: Fixed an issue where attempting to change a setting in a dropdown back to it's original value after changing it would do nothing

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 4, 2025
@probably-neb probably-neb merged commit d8655f0 into main Nov 4, 2025
24 checks passed
@probably-neb probably-neb deleted the fix-settings-ui-dropdowns branch November 4, 2025 17:46
ConradIrwin pushed a commit that referenced this pull request Nov 4, 2025
Closes #41533

Both of the issues in the release notes that are fixed in this PR, were
caused by incorrect usage of the `window.use_state` API.
The first issue was caused by calling `window.use_state` in a render
helper, resulting in the element ID used to share state being the same
across different pages, resulting in the state being re-used when it
should have been re-created. The fix for this was to move the
`window.state` (and rendering logic) into a `impl RenderOnce` component,
so that the IDs are resolved during the render, avoiding the state
conflicts.

The second issue is caused by using a `move` closure in the
`window.use_state` call, resulting in stale closure values when the
window state is re-used.

Release Notes:

- settings_ui: Fixed an issue where some dropdown menus would show
options from a different dropdown when clicked
- settings_ui: Fixed an issue where attempting to change a setting in a
dropdown back to it's original value after changing it would do nothing
probably-neb added a commit that referenced this pull request Nov 4, 2025
Cherry-pick of #41920

----
Closes #41533

Both of the issues in the release notes that are fixed in this PR, were
caused by incorrect usage of the `window.use_state` API.
The first issue was caused by calling `window.use_state` in a render
helper, resulting in the element ID used to share state being the same
across different pages, resulting in the state being re-used when it
should have been re-created. The fix for this was to move the
`window.state` (and rendering logic) into a `impl RenderOnce` component,
so that the IDs are resolved during the render, avoiding the state
conflicts.

The second issue is caused by using a `move` closure in the
`window.use_state` call, resulting in stale closure values when the
window state is re-used.

Release Notes:

- settings_ui: Fixed an issue where some dropdown menus would show
options from a different dropdown when clicked
- settings_ui: Fixed an issue where attempting to change a setting in a
dropdown back to it's original value after changing it would do nothing

Co-authored-by: Ben Kunkle <[email protected]>
tomatitito pushed a commit to tomatitito/zed that referenced this pull request Nov 7, 2025
…#41920)

Closes zed-industries#41533

Both of the issues in the release notes that are fixed in this PR, were
caused by incorrect usage of the `window.use_state` API.
The first issue was caused by calling `window.use_state` in a render
helper, resulting in the element ID used to share state being the same
across different pages, resulting in the state being re-used when it
should have been re-created. The fix for this was to move the
`window.state` (and rendering logic) into a `impl RenderOnce` component,
so that the IDs are resolved during the render, avoiding the state
conflicts.

The second issue is caused by using a `move` closure in the
`window.use_state` call, resulting in stale closure values when the
window state is re-used.

Release Notes:

- settings_ui: Fixed an issue where some dropdown menus would show
options from a different dropdown when clicked
- settings_ui: Fixed an issue where attempting to change a setting in a
dropdown back to it's original value after changing it would do nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Base Keymap" and "Auto Save mode" option does not update along with item switch in the setting UI

2 participants