Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [Bug]: 画布删除组件后,组件相关样式没有自动删除问题 #783

Open
langyjn opened this issue Sep 2, 2024 · 3 comments
Labels
question Further information is requested

Comments

@langyjn
Copy link

langyjn commented Sep 2, 2024

Environment

chrome

Version

latest

Version

latest

Link to minimal reproduction

none

Step to reproduce

  1. 拖入一个组件,修改样式,然后删除组件
    1
  2. 删除组件后,查看页面样式,可见组件样式代码没有同步删除
    2

What is expected

No response

What is actually happening

No response

What is your project name

tiny-engine develop

Any additional comments (optional)

No response

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: 🐛 [Bug]: After deleting a component from the canvas, the component-related styles are not automatically deleted.

@chilingling
Copy link
Member

这里没有支持自动删除的特性,主要是考虑到:

  1. 如果有多个组件同时使用了该样式,关联删除该样式会导致其他组件的样式被丢失。
  2. 如果该组件样式关联的样式有多个状态(:hover:active 等等),是否同样级联删除,是否有其他组件关联了这些级联状态的样式?
  3. 如果用户只是想删除了该组件,然后添加一个新组件,重新应用刚刚已经编排好的样式,自动删除关联的样式也是不符合需求的。

综合以上的考虑,估短期内不做自动删除的特性。
如果您有更好想法、实现,欢迎交流,贡献PR或者 idea @langyjn

@chilingling chilingling added the question Further information is requested label Sep 25, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


There is no feature to support automatic deletion, mainly due to:

  1. If multiple components use this style at the same time, deleting the style will cause the styles of other components to be lost.
  2. If the styles associated with this component style have multiple states (:hover, :active, etc.), will they also be deleted in cascade? Are there other components associated with the styles of these cascade states?
  3. If the user just wants to delete the component, then add a new component, and re-apply the style that has just been arranged, automatically deleting the associated style does not meet the needs.

Based on the above considerations, it is estimated that automatic deletion will not be implemented in the short term.
If you have better ideas and implementations, welcome to communicate, contribute PR or idea @langyjn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants