microsoft / fluentui-contrib

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

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

Closed george-cz closed 4 months ago

george-cz commented 4 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.