有人可以确定该编辑DIV的工具栏可能是什么?

发布于 2025-02-03 20:26:25 字数 889 浏览 3 评论 0原文

我正在使用将图像粘贴到DIV的能力,然后将其通过后请求上传。到目前为止,它似乎正在起作用,但是我注意到该工具栏在我进行内容可编辑时似乎显示出来。因此,用户能够操纵DIV,而不仅仅是粘贴图像,这是我不希望他们做的。

<div tabindex="1" id="pasteZone" contenteditable="true" onkeypress="return false">
  <span id="pasteMessage">Right click and paste an image, or click and press (ctrl+v for windows or ⌘+V for Mac)</span>
</div>

我需要可以编辑粘贴区域,以便Windows上下文菜单允许该选项粘贴屏幕截图,并可以选择CTRL+V或您有什么。但是我也不希望我的用户能够添加文本。就关键按下而言,我似乎可以成功地做到这一点,但是工具栏破坏了这种可能性。

我已经做了什么:

我在线查看是否发生了其他示例,但在这个特定问题上找不到任何东西。我检查了一下这是否是启用了任何可满足的Div的标准,但事实并非如此。具有此功能的其他网站并未显示此工具栏。这使我相信这与Bootstrap有关。如果是这种情况,我将如何防止该工具栏显示?

图像:

“

I was working with the ability to paste images into a div where it would then be uploaded via a post request. So far it seems to be working, but I noticed this toolbar that seems to show up when I make the content editable. As a result of this, the user is able to manipulate the div beyond just pasting an image which is what I do not want them to do.

<div tabindex="1" id="pasteZone" contenteditable="true" onkeypress="return false">
  <span id="pasteMessage">Right click and paste an image, or click and press (ctrl+v for windows or ⌘+V for Mac)</span>
</div>

I need the paste zone to be editable so that the windows context menu allows for the option to paste the screenshot and have the option to ctrl+v or what have you. But I also do not want my users to be able to add text. It seems that I am able to do that successfully as far as key presses go, but the toolbar destroys that possibility.

What I have done:

I looked online to see if other examples of this occurred but I could not find anything on this particular issue. I checked to see if this was the standard for any contenteditable enabled div, but it is not. Other websites that have this do not show this toolbar.This leads me to believe that this has something to do with Bootstrap. If this is the case, how would I prevent this toolbar from showing?

Image:

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文