在空元素上显示占位符时,边界不被考虑
问题
葡萄JS版本
- 我确认使用最新版本的GrapesJS
你用的是什么浏览器?
Edge 最后版本
可复制演示链接
描述一下那个虫子
如何复现这个漏洞?
- 得到一个空元素
- 增加高价值的双重边界。(20......30像素......)
- 将任意方块移动到其中。

预期的行为是什么? 占位符应放在元素中心。
目前的行为是什么? 占位符显示在元素顶部,木板内侧
行为准则
- 我同意遵守本项目的行为准则
回答(2)
谢谢你举报,@ronaldohoch。 关于在空元素上显示占位符时,边界未被考虑,这是个很好的问题。GrapesJS 推荐的方法是使用事件驱动 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) =>...
相关问答
通过相似的问题讨论继续研究。
问题 #5583
在移动端版本中,无法用样式面板设置背景:无
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Edge 最后版本 可复制演示链接 https://grapesjs.com/demo 描述一下那个虫子 如何复现这个漏洞?打开演示链接点击页眉 。
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome v116.0.5845.97 可复制演示链接 https://grapesjs.com/demo.html 描述一下那个虫子 如何复现这个漏洞?从画布中选择任意组件打开图层管理器面板...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
GrapesJS DevTools: A Developer Panel Inside Your Editor
If you've ever debugged GrapesJS with console.log(editor.getSelected()) and a dozen throwaway event listeners — this post is for you.
教程
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
教程
Big Updates: TinyMCE 8 and Placeholder 2.0 for GrapesJS
In May we shipped major updates to two of our most popular GrapesJS plugins — TinyMCE Inline Text Editor and Placeholder.
浏览插件分类
直接跳转到市场上的插件分类页面。