@@ -58,14 +58,14 @@ import getContainerRenderMixin from 'rc-util/lib/getContainerRenderMixin';
58
58
59
59
Fields in ` config ` and their meanings.
60
60
61
- | Field | Type | Description | Default |
62
- | -------| ------| -------------| ---------|
63
- | autoMount | boolean | Whether to render component into container automatically | true |
64
- | autoDestroy | boolean | Whether to remove container automatically while the component is unmounted | true |
65
- | isVisible | (instance): boolean | A function to get current visibility of the component | - |
66
- | isForceRender | (instance): boolean | A function to determine whether to render popup even it's not visible | - |
67
- | getComponent | (instance, extra): ReactNode | A function to get the component which will be rendered into container | - |
68
- | getContainer | (instance): HTMLElement | A function to get the container | |
61
+ | Field | Type | Description | Default |
62
+ | ------------- | ---------------------------- | -------------------------------------------------------------------------- | ------- |
63
+ | autoMount | boolean | Whether to render component into container automatically | true |
64
+ | autoDestroy | boolean | Whether to remove container automatically while the component is unmounted | true |
65
+ | isVisible | (instance): boolean | A function to get current visibility of the component | - |
66
+ | isForceRender | (instance): boolean | A function to determine whether to render popup even it's not visible | - |
67
+ | getComponent | (instance, extra): ReactNode | A function to get the component which will be rendered into container | - |
68
+ | getContainer | (instance): HTMLElement | A function to get the container | |
69
69
70
70
### Portal
71
71
@@ -77,11 +77,10 @@ import Portal from 'rc-util/lib/Portal';
77
77
78
78
Props:
79
79
80
- | Prop | Type | Description | Default |
81
- | -------| ------| -------------| ---------|
82
- | children | ReactChildren | Content render to the container | - |
83
- | getContainer | (): HTMLElement | A function to get the container | - |
84
-
80
+ | Prop | Type | Description | Default |
81
+ | ------------ | --------------- | ------------------------------- | ------- |
82
+ | children | ReactChildren | Content render to the container | - |
83
+ | getContainer | (): HTMLElement | A function to get the container | - |
85
84
86
85
### getScrollBarSize
87
86
@@ -190,9 +189,9 @@ import canUseDom from 'rc-util/lib/Dom/canUseDom';
190
189
191
190
A collection of functions to operate DOM nodes' class name.
192
191
193
- * ` hasClass(node: HTMLElement, className: string): boolean `
194
- * ` addClass(node: HTMLElement, className: string): void `
195
- * ` removeClass(node: HTMLElement, className: string): void `
192
+ - ` hasClass(node: HTMLElement, className: string): boolean `
193
+ - ` addClass(node: HTMLElement, className: string): void `
194
+ - ` removeClass(node: HTMLElement, className: string): void `
196
195
197
196
``` jsx
198
197
import cssClass from ' rc-util/lib/Dom/class;
@@ -212,14 +211,14 @@ import contains from 'rc-util/lib/Dom/contains';
212
211
213
212
A collection of functions to get or set css styles.
214
213
215
- * `get(node: HTMLElement, name?: string): any`
216
- * `set(node: HTMLElement, name?: string, value: any) | set(node, object)`
217
- * `getOuterWidth(el: HTMLElement): number`
218
- * `getOuterHeight(el: HTMLElement): number`
219
- * `getDocSize(): { width: number, height: number }`
220
- * `getClientSize(): { width: number, height: number }`
221
- * `getScroll(): { scrollLeft: number, scrollTop: number }`
222
- * `getOffset(node: HTMLElement): { left: number, top: number }`
214
+ - `get(node: HTMLElement, name?: string): any`
215
+ - `set(node: HTMLElement, name?: string, value: any) | set(node, object)`
216
+ - `getOuterWidth(el: HTMLElement): number`
217
+ - `getOuterHeight(el: HTMLElement): number`
218
+ - `getDocSize(): { width: number, height: number }`
219
+ - `getClientSize(): { width: number, height: number }`
220
+ - `getScroll(): { scrollLeft: number, scrollTop: number }`
221
+ - `getOffset(node: HTMLElement): { left: number, top: number }`
223
222
224
223
```jsx
225
224
import css from ' rc-util/lib/Dom/css' ;
@@ -229,11 +228,11 @@ import css from 'rc-util/lib/Dom/css';
229
228
230
229
A collection of functions to operate focus status of DOM node.
231
230
232
- * `saveLastFocusNode(): void`
233
- * `clearLastFocusNode(): void`
234
- * `backLastFocusNode(): void`
235
- * `getFocusNodeList(node: HTMLElement): HTMLElement[]` get a list of focusable nodes from the subtree of node.
236
- * `limitTabRange(node: HTMLElement, e: Event): void`
231
+ - `saveLastFocusNode(): void`
232
+ - `clearLastFocusNode(): void`
233
+ - `backLastFocusNode(): void`
234
+ - `getFocusNodeList(node: HTMLElement): HTMLElement[]` get a list of focusable nodes from the subtree of node.
235
+ - `limitTabRange(node: HTMLElement, e: Event): void`
237
236
238
237
```jsx
239
238
import focus from ' rc-util/lib/Dom/focus' ;
@@ -271,20 +270,26 @@ Whether text and modified key is entered at the same time.
271
270
272
271
Whether character is entered.
273
272
274
- ### switchScrollingEffect
273
+ ### ScrollLocker
275
274
276
- > (close: boolean ) => void
275
+ > ScrollLocker<{lock: (options: {container: HTMLElement} ) => void, unLock: () => void}>
277
276
278
277
improve shake when page scroll bar hidden.
279
278
280
- `switchScrollingEffect ` change body style, and add a class `ant-scrolling-effect` when called, so if you page look abnormal, please check this;
279
+ `ScrollLocker ` change body style, and add a class `ant-scrolling-effect` when called, so if you page look abnormal, please check this;
281
280
282
281
```js
283
- import switchScrollingEffect from "./src/switchScrollingEffect";
282
+ import ScrollLocker from ' rc-util/lib/Dom/scrollLocker' ;
283
+
284
+ const scrollLocker = new ScrollLocker();
285
+
286
+ // lock
287
+ scrollLocker.lock()
284
288
285
- switchScrollingEffect();
289
+ // unLock
290
+ scrollLocker.unLock()
286
291
```
287
292
288
293
## License
289
294
290
- [MIT](/LICENSE)
295
+ [MIT](/LICENSE)
0 commit comments