在粘贴大于特定高度的内容后,Quill 在基于 webkit 的浏览器(如 chrome)上滚动到顶部 [英] Quill scrolls to top on webkit based browsers like chrome, after pasting content larger than certain height

查看:99
本文介绍了在粘贴大于特定高度的内容后,Quill 在基于 webkit 的浏览器(如 chrome)上滚动到顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的主要问题 这里

我正在尝试在他们的 playground

我尝试添加一个滚动容器,并为元素设置高度,但是

你也可以找到codeandbox demo 这里

如果您粘贴大量内容,在达到一定高度后,页面会向上滚动到编辑器的顶部...导致非常不和谐的体验.

解决方案

自动增长示例 in quill.

经过反复试验,即将推出的2.0.0可以完美解决.

截至 2021 年 5 月 22 日,最新版本为 2.0.0-dev.4

yarn add quill@2.0.0-dev.4//或者npm 安装 quill@2.0.0-dev.4

用于演示的代码沙盒示例:

https://codesandbox.io/s/importing-sass-in-vue-forked-cp8jn?file=/src/components/HelloWorld.vue

This was my main question here

I am trying to replicate the auto-grow example on their playground

I tried to add a scrolling container, and set heights for elements but

You can also find a codesandbox demo here

If you paste alot of content, after a certain height, the page would scroll up to the top of the editor... resulting in a very jarring experience.

解决方案

The scroll to top problem with large amount of text cannot even be solved by the Autogrow example in quill.

After some trial and errors, the upcoming 2.0.0 can solve it perfectly.

As of 22-May-2021, the latest version is 2.0.0-dev.4

yarn add quill@2.0.0-dev.4
// or
npm install quill@2.0.0-dev.4

The codesandbox example for demostration:

https://codesandbox.io/s/importing-sass-in-vue-forked-cp8jn?file=/src/components/HelloWorld.vue

这篇关于在粘贴大于特定高度的内容后,Quill 在基于 webkit 的浏览器(如 chrome)上滚动到顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆