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
and enable ☑ Use middle click to "paste" content of the clipboard
and enable ☑ only paste with single-line input boxes
I think you should probably understand the meaning!
In other words, it is recommended to add a new sub-option.
When this sub-option is enabled, the paste behavior will determine the element type of the input/edit box.
Why is such an extra suboption needed?
Because in multi-line input/edit boxes like textarea, I want middle-click scrolling, but don't want to trigger accidental paste behavior. In a multi-line edit box, it is easy to accidentally trigger paste without knowing it. But in a simple single-line edit box, even if the paste is accidentally triggered, it can be easily found.
Also because of this feature suggestion, it is easy to be implemented.
So came up with the idea, for some people, to get the best balance between scrolling and pasting behavior of the middle-click.
Mouse events can determine the element type, so we can easily implement,
I don't understand the overall event logic of ScrollAnywhere, but the simple code of the function is about as follows
addEventListener(`mouseup`,e=>{constTARGET=e.target;if(UserOptions.PASTE&&e.button===1&&TARGET.matches(`input[type=text], input[type=search], input[type=number]`&&!e.ctrlKey&&!e.shiftKey&&!e.altKey){event.preventDefault();event.stopPropagation();event.stopImmediatePropagation();// Do: Use middle click to "paste" content of the clipboard}// or 👇 recommended to use the negative exclusion method to write more perfectly!if(UserOptions.PASTE&&e.button===1&&!(TARGET.matches(`textarea`)||TARGET.isContentEditable)&&!e.ctrlKey&&!e.shiftKey&&!e.altKey){// Do: Use middle click to "paste" content of the clipboard}});
That is to say, Paste behavior is only triggered when not (TARGET.matches('textarea') || TARGET.isContentEditable)
So, is it possible to add a suboption for this feature?❓
The text was updated successfully, but these errors were encountered:
Hmm... did you actually accidentally pasted a text instead of scrolling?
The pasting will happen only if you click, without a single move of the mouse, so it should be rare.
I need to test it more myself, but if this is something people would use, I don't see why not.
Also, no need to add code snippets :), I know my stuff very well :).
Hmm... did you actually accidentally pasted a text instead of scrolling?
It is the accident of worrying about misoperation, and I don't know that I have pasted the text.
For multi-line edit boxes such as textarea, it is best to be careful when editing, right?
For the clipboard, there may be dozens of hundreds of thousands of lines of text, if you accidentally paste it by middle-click....
In general, in a multi-line edit box, I don't want the middle-click to trigger the paste. Although pressing the middle button and middle-click are two different events, they are deeply related after all...
For a simple single-line edit box, we don't need to think too much and don't need too much careful.
At the same time, the common scenarios of middle-click paste are enabled.
For example, sometimes you don't want to use the keyboard(Ctrl+V) or right-click contextmenu, but directly paste the keyword with the middle-click of the mouse in the search box of the page, and then click the search button to open the search results!
First look at the screenshot - UI options
middle click
to ScrollAnywhere.Use middle click to "paste" content of the clipboard
only paste with single-line input boxes
In other words, it is recommended to add a new sub-option.
When this sub-option is enabled, the paste behavior will determine the element type of the input/edit box.
Because in multi-line input/edit boxes like
textarea
, I want middle-click scrolling, but don't want to trigger accidental paste behavior. In a multi-line edit box, it is easy to accidentally trigger paste without knowing it. But in a simple single-line edit box, even if the paste is accidentally triggered, it can be easily found.Also because of this feature suggestion, it is easy to be implemented.
So came up with the idea, for some people, to get the best balance between scrolling and pasting behavior of the middle-click.
input[type=text]
input[type=search]
input[type=number]
...textarea
[contenteditable=true]
/isContentEditable
Mouse events can determine the element type, so we can easily implement,
That is to say, Paste behavior is only triggered when not
(TARGET.matches('textarea') || TARGET.isContentEditable)
So, is it possible to add a suboption for this feature?❓
The text was updated successfully, but these errors were encountered: