Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bug in _highlight #59

Closed
SapientGuardian opened this issue Jun 29, 2023 · 0 comments
Closed

Bug in _highlight #59

SapientGuardian opened this issue Jun 29, 2023 · 0 comments
Labels

Comments

@SapientGuardian
Copy link

https://github.com/Mobius1/Selectable/blob/0.19.0/selectable.js#L1707

  if (item.selecting) {
                        classList.remove(el, o.classes.selecting);
                        item.selecting = false;
                        if (cmd && item.startselected) {
                            classList.add(el, o.classes.selected);
                            item.selected = true;
                        } else {
                            if (item.startselected && !o.toggle) {
                                classList.add(el, o.classes.deselecting);
                                item.deselecting = true;
                            }
                        }
                    }
                    if (el.selected) {
                        if (!cmd) {
                            if (!item.startselected) {
                                classList.remove(el, o.classes.selected);
                                item.selected = false;

                                classList.add(el, o.classes.deselecting);
                                item.deselecting = true;
                            }
                        }
                    }

I don't think this check for el.selected is correct; I believe it should be item.selected. el would be the DOM element, which doesn't appear to ever get .selected set on it.

@Mobius1 Mobius1 added the bug label Jul 1, 2023
@Mobius1 Mobius1 closed this as completed in f00926c Jul 1, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants