简体   繁体   English

一页上有多个tinymce文本区域-正确的Chrome菜单并不总是出现

[英]Multiple tinymce textareas on one page — correct chrome menu not always appearing

I have a page with multiple tinymce textareas, using the browser's default context menu. 使用浏览器的默认上下文菜单,我有一个包含多个tinymce文本区域的页面。 The issue I'm having is that sometimes Chrome will show the correct textarea context menu (cut, copy, paste, etc.), but every second time I open the context menu (roughly), it shows the non-textarea content menu (back, forward, reload, etc.) 我遇到的问题是,有时Chrome会显示正确的textarea上下文菜单(剪切,复制,粘贴等),但是每隔两次打开上下文菜单(大约),它将显示非textarea内容菜单(后退,前进,重新加载等)

I've a sample Fiddle here demonstrating the issue: http://fiddle.tinymce.com/Bugaab 我在这里有一个样本小提琴演示了这个问题: http : //fiddle.tinymce.com/Bugaab

If you right click in either text area (in Chrome) a few times, in different locations, the different menus will appear. 如果您在任一文本区域(在Chrome中)右键单击几次,将在不同的位置出现不同的菜单。

I'm fairly sure I'm initializing the controls correctly. 我相当确定我可以正确初始化控件。 The problem doesn't occur with only a single textarea. 仅单个文本区域不会发生此问题。

Any help appreciated. 任何帮助表示赞赏。

Not quite. 不完全的。 It's not a tinymce context menu at all. 它根本不是tinymce上下文菜单。 That's Chrome's context menu when it opens inside an input or textarea. 当它在输入或文本区域内打开时,这就是Chrome的上下文菜单。 It has different menu items depending on the context. 根据上下文,它具有不同的菜单项。

I said earlier that the issue didn't occur when only a single tinymce textarea was on page, but I see now this was incorrect. 我之前说过,当页面上只有一个tinymce文本区域时,不会发生此问题,但是我现在发现这是不正确的。 The issue happens for every tinymce textarea. 每个tinymce文本区域都会出现此问题。

I think the problem is to do with the area of the textarea. 我认为问题与文本区域有关。 Tinymce hides the actual native textarea control and draws its own, and it's probably incorrectly mapping the dimensions somehow, confusing Chrome into thinking the mouse click is outside the control. Tinymce隐藏了实际的本地textarea控件并绘制了自己的控件,并且它可能以某种方式错误地映射了尺寸,从而使Chrome浏览器认为鼠标单击不在控件内。

From what I've seen, the norm with this control is to use its own context menu rather than rely on the browsers, which is probably why I've had such difficulty finding mentions of the Chrome problem anywhere. 从我所看到的,此控件的规范是使用其自己的上下文菜单,而不是依赖于浏览器,这可能就是为什么我在任何地方都找不到提及Chrome问题的困难之处。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM