File tree 3 files changed +14
-15
lines changed
3 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -173,15 +173,15 @@ extend the behavior of the library.
173
173
## Return value
174
174
175
175
``` ts
176
- type ComputePositionReturn = {
176
+ interface ComputePositionReturn {
177
177
x: number ;
178
178
y: number ;
179
179
// The stateful placement, which can be different
180
180
// from the initial `placement` passed as options
181
181
placement: Placement ;
182
182
strategy: Strategy ;
183
183
middlewareData: MiddlewareData ;
184
- };
184
+ }
185
185
```
186
186
187
187
## Updating
Original file line number Diff line number Diff line change @@ -97,10 +97,5 @@ can be passed in to choose a rect.
97
97
98
98
default: ` 2{:js} `
99
99
100
- > Experimental
101
-
102
100
This describes the padding around a disjoined rect when choosing
103
101
it.
104
-
105
- This option's configurability is currently experimental and may
106
- be removed by v1. You likely don't need to change the default.
Original file line number Diff line number Diff line change @@ -58,11 +58,9 @@ interface AxesOffsets {
58
58
type Options =
59
59
| number
60
60
| AxesOffsets
61
- | (({
62
- reference: Rect ,
63
- floating: Rect ,
64
- placement: Placement ,
65
- }) => number | AxesOffsets );
61
+ | ((
62
+ middlewareArguments : MiddlewareArguments
63
+ ) => number | AxesOffsets );
66
64
```
67
65
68
66
A number represents the distance (gutter or margin) between the
@@ -145,6 +143,12 @@ values enables the ability to "inset" the floating element such
145
143
that it is positioned on top of the reference element in some
146
144
fashion.
147
145
148
- This is useful for UI components such as select dropdowns where
149
- it should be positioned relative to an item inside the dropdown
150
- list.
146
+ For instance, if you wanted to mimic something like
147
+ ` 'center'{:js} ` for ` placement{:.objectKey} ` (with default
148
+ placement):
149
+
150
+ ``` js
151
+ offset (({rects}) => {
152
+ return - rects .reference .height / 2 - rects .floating .height / 2 ;
153
+ });
154
+ ```
You can’t perform that action at this time.
0 commit comments