mirror of
https://github.com/zotero/zotero.git
synced 2026-09-27 01:21:27 +00:00
Reader: Only show text context menu when interacting with a text box
This commit is contained in:
parent
4808ebd2e9
commit
bdcc5c551a
1 changed files with 11 additions and 3 deletions
|
|
@ -1187,10 +1187,18 @@ class ReaderInstance {
|
|||
_handleReaderTextboxContextMenuOpen = (event) => {
|
||||
this._window.goUpdateGlobalEditMenuItems(true);
|
||||
|
||||
function isEditableTextBox(node) {
|
||||
return (
|
||||
node.nodeName === 'TEXTAREA'
|
||||
|| (node.nodeName === 'INPUT' && node.type === 'text' && !node.disabled && !node.readOnly)
|
||||
|| node.isContentEditable === true
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
event.view !== this._iframeWindow
|
||||
// For text annotation box
|
||||
&& (this._type !== 'pdf' || event.target?.nodeName !== 'TEXTAREA')
|
||||
!event.target
|
||||
|| !((event.view === this._iframeWindow || this._type === 'pdf')
|
||||
&& isEditableTextBox(event.target))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue