fix: playground parameters area resizable

This commit is contained in:
jialin
2025-05-20 19:33:10 +08:00
parent 174f93fe11
commit 1c11e73ff8
11 changed files with 82 additions and 21 deletions
+13 -2
View File
@@ -6,8 +6,18 @@ import {
import React, { useEffect } from 'react';
import useUserSettings from './use-user-settings';
type OverflowBehavior =
| 'hidden'
| 'scroll'
| 'visible'
| 'visible-hidden'
| 'visible-scroll';
export interface OverlayScrollerOptions {
oppositeTheme?: boolean;
overflow?: {
x?: OverflowBehavior;
y?: OverflowBehavior;
};
scrollbars?: {
theme?: 'os-theme-light' | 'os-theme-dark';
autoHide?: 'never' | 'scroll' | 'leave' | 'move';
@@ -46,7 +56,7 @@ export default function useOverlayScroller(data?: {
}) {
const { userSettings } = useUserSettings();
const { options, events, defer = true } = data || {};
const { scrollbars, oppositeTheme } = options || {};
const { scrollbars, overflow, oppositeTheme } = options || {};
const scrollEventElement = React.useRef<any>(null);
const instanceRef = React.useRef<any>(null);
const initialized = React.useRef(false);
@@ -59,7 +69,8 @@ export default function useOverlayScroller(data?: {
debounce: 0
},
overflow: {
x: 'hidden'
x: 'hidden',
...overflow
},
scrollbars: {
autoHide: 'scroll',