gpt4 book ai didi

Firefox sets wrong caret position contentEditable when insert img tag(Firefox在插入img标签时设置错误的插入符号位置content可编辑)

转载 作者:bug小助手 更新时间:2023-10-25 17:21:23 25 4
gpt4 key购买 nike



when i insert an image inside a contenteditable everything is normal with the browser like chrome, edge... However when I use firefox caret position is skewed .I don't know what's going on, please help me . Thank you in advance.
this is my simple code :

当我在内容满意的浏览器中插入一个图像时,一切都是正常的,比如Chrome、Edge…但是当我使用Firefox的时候,插入符号的位置出现了偏差。我不知道怎么回事,请帮帮我。提前谢谢您。这是我的简单代码:




.img-styl-cted {
vertical-align: middle;
width: 24px;
height: 24px;
display: inline-block;
padding-left: 2px;
padding-right: 2px;
}

.div-ctedab {
padding:10px;
border: 1px solid;
}

<div contenteditable class="div-ctedab">
<img src="https://images.immediate.co.uk/production/volatile/sites/3/2023/03/goku-dragon-ball-guru-824x490-11b2006.jpg" class="img-styl-cted"><img src="https://images.immediate.co.uk/production/volatile/sites/3/2023/03/goku-dragon-ball-guru-824x490-11b2006.jpg" class="img-styl-cted"><img src="https://images.immediate.co.uk/production/volatile/sites/3/2023/03/goku-dragon-ball-guru-824x490-11b2006.jpg" class="img-styl-cted">
</div>




this is what shows in chrome, edge...

这就是铬,边显示的.


display in chrome


and firefox is skewed as follows :

火狐的歪曲如下:


firefox display


I don't have any solution until now and and I hope someone will share the solution to this problem

我到目前为止还没有任何解决方案,我希望有人能分享这个问题的解决方案


更多回答

This is pretty weird because the cursor initially is shifted down, but as soon as you type text in Firefox it then corrects to look as you would expect. Because of this I kind of wonder if this is a Firefox bug because to me your code looks fine

这很奇怪,因为光标一开始是向下移动的,但只要你在Firefox中输入文本,它就会更正为您预期的外观。正因为如此,我想知道这是不是Firefox的错误,因为在我看来,您的代码看起来很好

优秀答案推荐
更多回答

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com