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

Ranger selection does not trigger mousemove event. #935

Open
lucianbaciu opened this issue Mar 11, 2024 · 5 comments
Open

Ranger selection does not trigger mousemove event. #935

lucianbaciu opened this issue Mar 11, 2024 · 5 comments
Labels
question Further information is requested

Comments

@lucianbaciu
Copy link

In 1.6.21 this does not exist.

In the latest versions, while hovering a time selection, the position line event is not working.

The line is moving well when hovering outside of the blue selection

Screenshot_1526

@leeoniya
Copy link
Owner

leeoniya commented Mar 11, 2024

this change was intentional to avoid triggering mouse events that uplot listens to while the user interacts with third-party dom elements that are added into .u-over (like an anchored tooltip). it was introduced in bab8c11

you should be able to restore the previous behavior by overriding cursor.bind.* with functions that dont do any event target filtering:

bab8c11#diff-ad6d196bc8d38207d186017fc5c2c52660db3a546ccfdfe167fd7ad0c727cdeeR441-R443

a different, probably better approach is to set css pointer-events: none on the highlight region but keep the grip portion responding to events like normal.

@leeoniya leeoniya added the question Further information is requested label Mar 11, 2024
@lucianbaciu
Copy link
Author

pointer-events: none could be an option, but I'm not sure if it's possible

image

u-select::before is the blue part. u-select is capturing the event. If I set it as pointer-events: none, the grips (which are children) will be also disabled. If I disable events only in the ::before, the main u-select is eating the event

am I missing something?

@leeoniya
Copy link
Owner

ah yeah, i forgot the demo implements the grips as select children. then you're right, you can't use the css strategy.

on("mousedown", sel, e => {
bindMove(e, e => update(lft0 + (e.clientX - x0), wid0));
});
on("mousedown", placeDiv(sel, "u-grip-l"), e => {
bindMove(e, e => update(lft0 + (e.clientX - x0), wid0 - (e.clientX - x0)));
});
on("mousedown", placeDiv(sel, "u-grip-r"), e => {
bindMove(e, e => update(lft0, wid0 + (e.clientX - x0)));
});

@leeoniya
Copy link
Owner

leeoniya commented Mar 11, 2024

i'm leaning towards adding the .u-select into the current filter, since it is also "native" to uPlot, like .u-over. hopefully it doesnt affect perf too much to check against two elements during mousemoves vs just one. in most cases i think we can bypass the check when the select size is 0.

@lucianbaciu
Copy link
Author

thank you! I will try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants