-
Notifications
You must be signed in to change notification settings - Fork 4
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
🚩PR: Fixed runtime error for dropdown select list #573
Conversation
Seemingly works as intended. |
type SelectOption = { title: string; value: any }; | ||
|
||
function getDefaultSelected() { | ||
const obj = options.find((e: SelectOption) => e.value === target); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it possible to accept invalid or undefined default target => Empty selectbox
} | ||
function handleSelectionChange(selected: { label: string; value: any }) { | ||
if (selected === target) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use case:
NEVER update target if no actual selection change happened
If target is updated from the outside (correctly) change selection, (target should not change twice, in this case again from the inside)
If target is changed from the inside, propagate change to the outside.
Closes #560
The fixed issue was the instable state management of MeltSelect.svelte. Fixed the selection state management logic.
Testing
The stresstesting of the select list is probably the way to go.
This component is used as a dropdown list in the following parts of editor:
Closes #582
Test dropdown for control element selection on Configuration panel in virtual mode too. See original issue of #582