mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: fix dragging in horizontal overflow component (#20018)
This commit is contained in:
@@ -78,19 +78,20 @@ export default class HorizontalOverflowNav extends Component {
|
||||
const mouseDragScroll = function (e) {
|
||||
let mouseChange = e.clientX - position.x;
|
||||
navPills.scrollLeft = position.left - mouseChange;
|
||||
|
||||
navPills.querySelectorAll("a").forEach((a) => {
|
||||
a.style.cursor = "grabbing";
|
||||
});
|
||||
};
|
||||
|
||||
navPills.querySelectorAll("a").forEach((a) => {
|
||||
a.style.cursor = "grabbing";
|
||||
});
|
||||
|
||||
const removeDragScroll = function () {
|
||||
document.removeEventListener("mousemove", mouseDragScroll);
|
||||
navPills.querySelectorAll("a").forEach((a) => {
|
||||
a.style.cursor = "pointer";
|
||||
});
|
||||
};
|
||||
|
||||
document.addEventListener("mousemove", mouseDragScroll, { once: true });
|
||||
document.addEventListener("mousemove", mouseDragScroll);
|
||||
document.addEventListener("mouseup", removeDragScroll, { once: true });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user