带有显示的跨度:没有一个没有显示Firefox中的空间棒
我们有一个用例,其中一些具有显示的跨度:无
添加到我们的内容可编辑的div中。
因此,当用户以某种方式降落在跨度上并尝试添加内容时,空间条就会在跨度内添加,从而不会在UI中显示。所有其他字符都可以正常工作。这个问题仅在空间上。
这似乎是一个唯一的问题。 Chrome工作正常。
能够使用此JSfiddle-> https://jsfiddle.net/senths/senths/senths/ehlp86zy/3/3/3/ (单击(单击)您好& amp;尝试添加空间)
使用的firefox版本:91.8.0esr(64位)
这是Firefox中预期的这种行为吗?
任何铅都值得赞赏。提前致谢。
We had a use case where some spans with display:none
is added to our content editable div.
So when the user somehow lands on the span and tries to add content, the space bars are getting added inside the span, thereby not showing up in the UI. All other characters are working fine. The issue is only with the space.
This seems to be a Firefox only issue. Chrome is working fine.
Was able to reproduce the issue using this jsfiddle -> https://jsfiddle.net/senths/ehLp86zy/3/ (click b/w hello & world and try to add space)
Firefox Version Used: 91.8.0esr (64-bit)
Is this behaviour expected in Firefox?
Any lead is appreciated. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对另一个答案感到困惑,据我所知,这里的解决方案恰恰相反。如果将
contenditable =“ false”
添加到span
,它将阻止空格添加到隐藏的span
。要了解正在发生的事情,请尝试在下面的代码中插入一个空间(没有
显示:无
,并且没有contineDectibal =“ false”
Confused by the other answer, to the best of my knowledge the solution here is the exact opposite. If you add
contenteditable="false"
to thespan
it will prevent spaces getting added to the hiddenspan
.To understand what's happening try inserting a space in the below code (without the
display: none
and without thecontenteditable="false"
如果您在跨度标签中设置continedable =“ true”,则我相信(我相信)您在Firefox中的意图如何工作。
Firefox中有一个已知的虫子已有4年的历史了。有关此信息的信息是: https://bugzilla.mozilla.mozilla.org/show_bug.cgi.cgi.cgi? id = 1489481
If you set contenteditable="true" inside the span tag this will work how (I believe) you intent it to in Firefox.
There is a know reported bug in Firefox that is 4 years old. Information about that is at: https://bugzilla.mozilla.org/show_bug.cgi?id=1489481