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

List Selector (two pane) can crash MATLAB due to HighlightedValue being empty in the set method #57

Open
rjackey opened this issue Jan 8, 2024 · 3 comments · Fixed by #58
Assignees
Labels
bug Something isn't working

Comments

@rjackey
Copy link
Member

rjackey commented Jan 8, 2024

g3198185 - The error comes from ListSelectorTwoPane.m. The following update is proposed:

    function set.HighlightedValue(obj,value)
        if isempty(value)
            return;
        end
        if isempty(obj.ItemsData)
            [~, obj.RightList.Value] = ismember(value, obj.Items);
        else
            [~, obj.RightList.Value] = ismember(value, obj.ItemsData);
        end
    end
@rjackey rjackey added the bug Something isn't working label Jan 8, 2024
@rjackey rjackey self-assigned this Jan 8, 2024
msulliva72 added a commit that referenced this issue Jan 10, 2024
- Fixed crash when converting app with tis compnent to auto-reflow app.
Resolves Issue #57 and Geck 3198185
@msulliva72 msulliva72 linked a pull request Jan 10, 2024 that will close this issue
@slootsjj
Copy link
Contributor

Question on this change:

Would the following proposal also solve the issue (I cannot reproduce it) and still allow for de-selection of the highlighted value?

function set.HighlightedValue(obj,value)
        if isempty(value)
            obj.RightList.Value = {};
            return;
        end
        if isempty(obj.ItemsData)
            [~, obj.RightList.Value] = ismember(value, obj.Items);
        else
            [~, obj.RightList.Value] = ismember(value, obj.ItemsData);
        end
    end

@rjackey
Copy link
Member Author

rjackey commented Apr 12, 2024

Yes that's a good idea. Was the right list not getting deselected before? You're welcome to submit a change.

@rjackey rjackey reopened this Apr 12, 2024
@slootsjj
Copy link
Contributor

Currently, the right list is not deselected if HighlightedValue is set to an empty value. I will submit a change to repair this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants