Replies: 8 comments 9 replies
|
This is something I'm actively looking into. It's obviously very easy to implement this, but doing so without impacting other functionality requires some thought. I think I have the right solution and will probably release something today to enable this, but do you mind providing a code snippet of your custom Node? There's a similar open issue here: #323. Just want to make sure my implementation covers the broadest use cases and is testable. |
|
Thanks for the kind words! We're really excited about the direction of the library and appreciate when you guys bring needs like this to our attention. I think I figured it out. The crux for me was making sure that resizability was still possible via our handles. I didn't want to have to put in the docs that you had to choose one or the other. Take a look at the video below and let me know if this is how you expect this feature to behave. It won't require props or anything. It should just work. Tagging @rohanrajpal as well. Untitled.mov |
|
That popping is really just a quirk of how unstyled buttons behave, unfortunately. Anything styled wouldn't have that issue. Width also adapts as seen below. I pushed this update into main but haven't released yet. Will do some more testing and release tomorrow. Screen.Recording.2023-05-03.at.10.21.37.PM.mov |
|
Yep, they respect whatever relative or absolute position you're using. |
|
This is live in v7.0.41 |
|
@briangregoryholmes Thanks for the awesome work! I'm still encountering an issue in my own use case. It may or may not be a Svelvet issue though, I'm not sure yet. I embed Carbon DataTables in custom nodes, as shown in the sample code below. You should see two table nodes side by side. https://stackblitz.com/edit/svelvet-carbon-q2efd2 Carbon DataTable has a Pagination component. Some buttons don't work when embedded in a svelvet node, as in right-side table. Once I wrap the same table with a div and set stopPropagation as in the left table, the buttons work, but then table & node size constantly get unsync, until I click anywhere of the canvas. |
|
@microdou Alright. v7.0.44 is up now. There were a lot of moving pieces to enabling this, not the least of which is some weird difference in implementation of the HTML select element between browsers, but I think I settled on something that covers most cases. Give it a shot and let me know. |
|
is there a minimum example where i can see the nodes make way for another node above it , |
Uh oh!
There was an error while loading. Please reload this page.
It looks like node's dimension is set upon mount. Thus when node's content changes size during user interaction, node container unfortunately remains its original size.
I'm currently using a workaround, by modifying the following code
Svelvet/src/lib/components/Node/InternalNode.svelte
Lines 271 to 272 in 6f53df1
to:
I have to fork/copy Svelvet to do so, and the workaround forces every single node to use css
fit-contentinstead of Svelvet's internal stores.Is there a better way, or it has to be a new feature?
All reactions