3 ms·
Good question. Internally every registered element has a grid position inside its own container [1]. And it's not CSS grid styling, it actually calculates the g
by jimmy2020 4y ago
Good question. Internally every registered element has a grid position inside its own container [1]. And it's not CSS grid styling, it actually calculates the geometry in each element and positioned them relative to their parent container. This is the implementation behind the enhanced transformation. Based on the grid position, DFlex can call the right method responsible for transformation instead of checking siblings linearly. For example, if you transform an element in the middle of the container it only invokes the switching position method instead of iteration in the entire tree. Still, grid implementation is not fully implemented and supported yet. But it's something that can be done in the next releases. However, the link you shared has an interesting case because you are resizing the element when appending it to the new container. I'd like to see a repo if it's possible but it's a very interesting case I'd love to look into it.
[1]- https://github.com/dflex-js/dflex/blob/cbda61af185100a3afb3959a2217e4d94d5b1b42/packages/dflex-core-instance/src/Element/DFlexCoreElement.ts#L191 https://github.com/dflex-js/dflex/blob/cbda61af185100a3afb39...
- pamelafox 4y agoThanks for the response! Here's the code for our use case: https://github.com/pamelafox/faded-parsons-static/blob/master/js-parsons/parsons.js#L467 https://github.com/pamelafox/faded-parsons-static/blob/maste... It calls jQuery UI sortable() with a "grid" of [50, 1], to mimic Python indentability. Here's their documentation for grid: https://api.jqueryui.com/sortable/#option-grid https://api.jqueryui.com/sortable/#option-grid
- jimmy2020 4y agoThanks for sharing the link I'll look into it soon.