这里发现一个小问题

来源:15-3 -图层-切换组件的hidden和locked

孟起笨猪

2024-06-27

当锁定某个组件后,然后使用 uparrow 或 downarrow 快捷键进行切换selectId,会发现可以选中到被隐藏的组件
它在画布上看不到,右侧属性面板也无法修改,只有左侧标题会蓝色高亮

写回答

1回答

双越

2024-06-27

感谢反馈,我记录下这个 bug 

0
1
孟起笨猪
// 选中上一个 selectPrevComponent: (state: ComponentStateType) => { const { selectId, componentList } = state const noHiddenComponentList = componentList.filter(c => !c.isHidden) const selectedIndex = noHiddenComponentList.findIndex(c => c.fe_id === selectId) if (selectedIndex < 0) return // 未选中组件 if (selectedIndex <= 0) return // 已经选中了第一个 state.selectId = noHiddenComponentList[selectedIndex - 1].fe_id }, // 选中下一个 selectNextComponent: (state: ComponentStateType) => { const { selectId, componentList } = state const noHiddenComponentList = componentList.filter(c => !c.isHidden) const selectedIndex = noHiddenComponentList.findIndex(c => c.fe_id === selectId) if (selectedIndex < 0) return // 未选中组件 if (selectedIndex + 1 === noHiddenComponentList.length) return // 已经选中了最后一个 state.selectId = noHiddenComponentList[selectedIndex + 1].fe_id } 在reducer 中过滤一下componentList 就可以了
2024-06-28
共1条回复

React18+ Nest.js 全栈开发仿问卷星项目

React18+TS4+Antd5+Next.js13 ,B端+C 端,完整业务

383 学习 · 252 问题

查看课程