react-resizable-panels 4.23.0 → 4.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -866,7 +866,7 @@ its default `aria-label` ("Collapse tabset") doesn't change, since `aria-expande
|
|
|
866
866
|
|
|
867
867
|
To keep the tabset as it is, call `event.preventDefault()` in an `onClick` handler.
|
|
868
868
|
|
|
869
|
-
ℹ️ Clicking a tab of a collapsed tabset also expands it.
|
|
869
|
+
ℹ️ Clicking a tab of a collapsed tabset also expands it (unless the workspace is `disabled`, which doesn't restrict this button).
|
|
870
870
|
|
|
871
871
|
#### Required props
|
|
872
872
|
|
|
@@ -1033,8 +1033,8 @@ The layout is described by a serializable model (see `WorkspaceModel`).
|
|
|
1033
1033
|
Workspaces are uncontrolled: provide an initial model with the `defaultModel` prop, save changes from the `onModelChanged` callback,
|
|
1034
1034
|
and make changes using the imperative API (see `WorkspaceImperativeHandle`).
|
|
1035
1035
|
|
|
1036
|
-
ℹ️ Tab content is not remounted when a tab is moved.
|
|
1037
|
-
|
|
1036
|
+
ℹ️ Tab content is not remounted when a tab is moved, and its browser state (e.g. iframes, playing media, and focus) is preserved where possible;
|
|
1037
|
+
browsers that don't support `moveBefore` (e.g. Safari) reset some of that state (e.g. iframes are reloaded).
|
|
1038
1038
|
|
|
1039
1039
|
Workspace elements always include the following attributes:
|
|
1040
1040
|
|
|
@@ -1170,7 +1170,8 @@ leaving the dragged tabset where it was. The change is reported to <code>onModel
|
|
|
1170
1170
|
<tr>
|
|
1171
1171
|
<td>disabled</td>
|
|
1172
1172
|
<td><p>Locks the arrangement: tabs cannot be resized, dragged, dropped, or closed by the user.
|
|
1173
|
-
Selecting tabs and maximizing tabsets still work
|
|
1173
|
+
Selecting tabs and maximizing tabsets still work, but tabsets aren't collapsed or expanded by clicking their tabs (or the empty space in their headers);
|
|
1174
|
+
clicking a tab of a collapsed tabset only selects it. A <code>TabsetCollapseButton</code> isn't restricted by <code>disabled</code>; to keep tabsets from being collapsed or expanded, don't render one.</p>
|
|
1174
1175
|
<p>ℹ️ This prop overrides the <code>disableClose</code> and <code>disableDrag</code> flags of individual tabs.</p>
|
|
1175
1176
|
</td>
|
|
1176
1177
|
</tr>
|
|
@@ -1191,7 +1192,8 @@ returning <code>true</code> rejects the target.</p>
|
|
|
1191
1192
|
so restrictions on where tabs can be dropped apply to dragged tabsets too.</p>
|
|
1192
1193
|
<p>ℹ️ Tabs can also be dropped at the edges of the workspace (beside all of the other tabsets), within a few pixels of the edges of its layout
|
|
1193
1194
|
(except over tabset headers, where the tab lists are) or within its root element's padding.
|
|
1194
|
-
These targets have an <code>edge</code> rather than a <code>tabsetId</code>; <code>disableDrop={({ target }) => "edge" in target}</code> turns them off
|
|
1195
|
+
These targets have an <code>edge</code> rather than a <code>tabsetId</code>; <code>disableDrop={({ target }) => "edge" in target}</code> turns them off.
|
|
1196
|
+
(Where a collapsed tabset lines an edge, drops there are added to the end of its tab list, so those targets have an <code>index</code> and <code>tabsetId</code> instead.)</p>
|
|
1195
1197
|
</td>
|
|
1196
1198
|
</tr>
|
|
1197
1199
|
<tr>
|
|
@@ -1239,8 +1241,8 @@ requires React 19.2 (falls back to <code>"keep-mounted"</code> otherwi
|
|
|
1239
1241
|
so e.g. collapsing a tabset hides its selected tab's content, and maximizing one hides the others'.
|
|
1240
1242
|
Temporary collapsed states (e.g. while dragging a separator, or when collapsed to fit) don't hide content.</p>
|
|
1241
1243
|
<p>ℹ️ Moving a tab never remounts its content (unless the move hides it and <code>hiddenTabBehavior</code> is <code>"unmount"</code>).</p>
|
|
1242
|
-
<p
|
|
1243
|
-
iframes are reloaded, playing media is paused, and focused elements are blurred.</p>
|
|
1244
|
+
<p>ℹ️ Its React state is preserved, and where possible its elements are moved within the document using <code>moveBefore</code>, which preserves browser state (iframes aren't reloaded, playing media isn't paused, and focused elements stay focused).</p>
|
|
1245
|
+
<p>⚠️ Browsers that don't support <code>moveBefore</code> (e.g. Safari) reset some of that state when a tab moves: iframes are reloaded, playing media is paused, and focused elements are blurred.</p>
|
|
1244
1246
|
</td>
|
|
1245
1247
|
</tr>
|
|
1246
1248
|
<tr>
|