Closed nova1751 closed 7 months ago
If the browser doesn't support execCommand
, it also doesn't support navigator.clipboard.writeText
If the browser doesn't support
execCommand
, it also doesn't supportnavigator.clipboard.writeText
Thanks for your relpy,but what I'm focused is the bug in the code below.
if (GLOBAL_CONFIG.Snackbar !== undefined) {
btf.snackbarShow(GLOBAL_CONFIG.copy.noSupport)
} else {
ctx.previousElementSibling.textContent = GLOBAL_CONFIG.copy.noSupport
}
It seems to just change the textcontent but not make the message to show up to remind the user.Is this a bug?
If the browser doesn't support
execCommand
, it also doesn't supportnavigator.clipboard.writeText
Thanks for your relpy,but what I'm focused is the bug in the code below.
if (GLOBAL_CONFIG.Snackbar !== undefined) { btf.snackbarShow(GLOBAL_CONFIG.copy.noSupport) } else { ctx.previousElementSibling.textContent = GLOBAL_CONFIG.copy.noSupport }
It seems to just change the textcontent but not make the message to show up to remind the user.Is this a bug?
if you use Snackbar, it will pop up and show the 'no support' message. if not, it will show the message before the copy button.
Oh,sorry,maybe I should explain it more specifically.The text show-up logic is like below,because the copy-notice
element's opacity is set to 0 initially.
const prevEle = ctx.previousElementSibling;
prevEle.textContent = msg;
prevEle.style.opacity = 1;
setTimeout(() => {
prevEle.style.opacity = 0;
}, 700);
However,there is only one line for browser-not-support case:
if (GLOBAL_CONFIG.Snackbar !== undefined) {
btf.snackbarShow(GLOBAL_CONFIG.copy.noSupport)
} else {
ctx.previousElementSibling.textContent = GLOBAL_CONFIG.copy.noSupport
}
As a result,the textcontent is changed but the the copy-notice
element's opacity attribute is still 0,which means copy-notice
element' won't show up to remind the user.
使用的 Butterfly 版本? | What version of Butterfly are you use?
4.10.0
是否修改过主题文件? || Has the theme files been modified?
不是 (No)
使用的瀏覽器? || What browse are you using?
Chrome
使用的系統? || What operating system are you using?
Windows
問題描述 | Describe the bug
I found that there seems to be a bug in the copy function when the browser doesn't support
execCommand
,it just changes the element's text content but doesn't make it show up to remind the user.The code inmain.js
is below: Maybe a code like this is more reasonable?I would appreciate it if you could answer soon.Thank you!😊出現問題網站 | Website
refrain.cf