Skip to content

3.4.0

Latest

Choose a tag to compare

@gfazioli gfazioli released this 07 Oct 14:07

✨ Features

  • keepInBounds (new prop on Window and option on useDragResize, true by default) keeps every window reachable inside its boundary, the viewport or its container:
    • when the boundary is measured or changes size (a phone rotating, a narrower browser window or container), and when the window itself changes size (a collapsed window opening), a window that sticks out moves back inside and one larger than the boundary shrinks to fit. A collapsed window keeps its expanded height;
    • during a drag, dragBounds can only narrow the boundary, so bounds written for a wide screen no longer let a window out of a phone's;
    • a pointer resize stops at the viewport edge, as keyboard resizing already did.
  • Touch screens: a swipe on content that overflows scrolls it instead of dragging the window (the mouse still drags from anywhere and scrolls with the wheel). On a coarse pointer the resize handles get bigger hit areas, and the title-bar buttons grow to 20px with their glyphs always visible.

🐛 Bug Fixes

  • A window followed the first finger on the screen, not its own: a finger resting on a second window dragged it along with the first. Each gesture now follows only the finger that started it, and a second finger on a window already being dragged is ignored.
  • Every touch drag logged Unable to preventDefault inside passive event listener invocation.
  • With draggable="both" (the default), a press on the title bar started the gesture twice: onDragStart fired twice and the z-index jumped twice.
  • A touch gesture whose end was lost now ends with the next touch, and the mouse events a browser emulates after a tap no longer start a second gesture. A real mouse on a touch laptop still works.

📝 Summary

Reported on the Mantine Extensions Discord from a Samsung S24 Ultra (Firefox) and an iPhone 16 Pro Max (Safari): overlapping windows were sometimes grabbed together, windows ended up outside their box, and the page overflowed after a rotation. All three are fixed (#61).

Heads-up, behavior change: with keepInBounds on by default, a window that used to start or end up partly outside its viewport or container is now moved inside, pointer resizing of a portal window stops at the viewport edge, and dragBounds wider than the boundary no longer lets a window out. keepInBounds={false} restores the 3.3 behavior.


What's Changed

  • fix(touch): one finger per gesture, scroll inside content, keepInBounds (#61) by @gfazioli in #63

Full Changelog: 3.3.0...3.4.0