mirror of
https://github.com/discourse/discourse.git
synced 2026-08-06 04:48:33 +08:00
Discourse carries several independently written resize implementations. The docked composer had its own: pointer capture, arrow-key stepping, and bound clamping, all inline. `dResizeEdge` extracts that interaction into a ui-kit modifier following the WAI-ARIA window splitter pattern. The modifier owns the interaction only. It reports the size it computed and leaves storing and applying it to the caller, so one element can drive a width held in a component or an offset written to a CSS custom property. `axis` selects which coordinate and which arrow keys drive it, and `side` is interpreted logically, so a right-to-left writing direction does not send the edge away from the pointer dragging it. It also sets `touch-action: none` on the element itself rather than relying on each caller's stylesheet, since a touch drag is otherwise claimed by the browser as a scroll and cancelled. `DockedComposer` now invokes the modifier in place of its four pointer and keyboard handlers, keeping its existing custom property names and ARIA values, so the rendered behaviour is unchanged. Covered by tests for pointer dragging, keyboard stepping and clamping on both axes, growth direction under `side` and under a right-to-left writing direction, and the pointer capture lifecycle. The composer's existing keyboard resize tests pass unchanged against the modifier. |
||
|---|---|---|
| .. | ||
| admin | ||
| common | ||
| lib | ||
| vendor | ||
| admin.scss | ||
| admin_rtl.scss | ||
| color_definitions.scss | ||
| common.scss | ||
| embed.scss | ||
| publish.scss | ||
| qunit-custom.scss | ||
| wcag.scss | ||
| wizard.scss | ||
| wizard_rtl.scss | ||