feat(components): [affix] support append-to and teleported#23053
Conversation
commit: |
|
🧪 Playground Preview: https://element-plus.run/?pr=23053 |
|
We can refer to other components and add |
Thanks for your suggestions. I've fixed it. |
|
The latest Playground Case |
rzzf
left a comment
There was a problem hiding this comment.
Thanks for your contribution! I have a suggestion.
Co-authored-by: rzzf <[email protected]>
Co-authored-by: rzzf <[email protected]>
Thanks. |
Co-authored-by: rzzf <[email protected]>
Co-authored-by: btea <[email protected]>
Co-authored-by: btea <[email protected]>
Co-authored-by: btea <[email protected]>
|
@micaiguai Thanks for your contribution! ❤️ |
|
Sir, may I ask, when the affix component is activated and switches between fixed and non-fixed states, it will trigger the unloading and re-mounting of the component. I noticed in the code of Element-plus that teleported has encapsulated an additional layer and uses v-if for switching. In fact, teleported has a disabled attribute for switching purposes. When using the affix component for fixed business with state, the state switching triggers the component's lifecycle again. Perhaps this is not what I expected. I would like to ask if there are any other considerations behind this design of teleported? |
Thanks for pointing this out! I've solved this problem. Related: #23219 (comment) |
|
Thank you very much, but I have encountered another issue. When scaling the screen with the push pin fixed, the width and height of the push pin will not change with the screen scaling, resulting in a horizontal scrollbar. Boss, can you help me take a look at this problem |

Close #22301
Problem
position: fixedbreaks when a parent hastransform,filter,perspective, etc.MDN Reference: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/position#fixed_positioning.
Solution
Support
appendToBodyprop.