Fix Citation modal responsiveness and clipboard copy (#29799)
The modal was broken in two ways: - On small screens, the input box was partially hanging outside the modal. Fixed with flexbox and increased modal width. - The clipboard copy was not working because the modal had both `data-clipboard-text` and `data-clipboard-target`, while we only support one of those. Made a small tweak in clipboard as well so that it will still fall back to target if text is empty. (cherry picked from commit 94512ee0628dc0d2b697441a4355ace54b6515cd)
This commit is contained in:
parent
5a16c9d9c0
commit
ca39d74363
4 changed files with 12 additions and 20 deletions
|
@ -15,10 +15,8 @@ export function initGlobalCopyToClipboardListener() {
|
|||
|
||||
e.preventDefault();
|
||||
|
||||
let text;
|
||||
if (target.hasAttribute('data-clipboard-text')) {
|
||||
text = target.getAttribute('data-clipboard-text');
|
||||
} else {
|
||||
let text = target.getAttribute('data-clipboard-text');
|
||||
if (!text) {
|
||||
text = document.querySelector(target.getAttribute('data-clipboard-target'))?.value;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue