microsoft / fluentui-contrib

Monorepo for contributor extension packages to Fluent UI
MIT License
29 stars 31 forks source link

feat(react-resize-handle): Allow relative panel adjustments #194

Closed george-cz closed 2 months ago

george-cz commented 3 months ago

This PR adds possibility to use relative sizes in combination with resizable panels. Only the difference from the default dimension is measured, which, when plugged in the calc function, results in only relative adjustments. This also fixes 2 issues:

This PR also lifts the current value from individual handlers to the main useResizeHandle hook, making sure that individual handlers don't keep their state and therefore don't conflict, it also makes sure that the current width is taken each time the resizing starts, further eliminating the potential disconnect between the internal state and DOM.