You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Outside of the select component, click the mouse button and hold.
Drag the cursor over the select component and release the mouse button.
The select incorrectly opens up as per images below
I tested with a standard select and it does not dropdown on mouse button release.
This is causing an issue with copy and paste as seen below.
User highlights the number and as the cursor has hovered over select - it steals focus from the number I wanted to copy and expands the select...
The text was updated successfully, but these errors were encountered:
FYI I fixed the issued by stopping the pointerup event and trigger on the click event. Additionally I added the ability to copy and paste text within a select too.
onMount(() => {
// fix bug where the original coding for svelte-select uses pointerup event instead of onclick event!
const selectItem = document.getElementById(id);
if (selectItem) {
const container = selectItem.parentNode.parentNode;
container.addEventListener(
"pointerup",
(e) => {
e.stopPropagation();
},
true
);
container.addEventListener(
"click",
() => {
// allow selection of text rather than stop selection
const selectedText = window.getSelection().toString();
if (!selectedText) {
listOpen = !listOpen;
}
},
false
);
}
});
This is causing an issue with copy and paste as seen below.
User highlights the number and as the cursor has hovered over select - it steals focus from the number I wanted to copy and expands the select...
The text was updated successfully, but these errors were encountered: