Skip to content

Commit 9f6ddfc

Browse files
committed
fix: vertical resizable starts at 50% height
- Add key prop to Resizable to force remount when switching between horizontal and vertical modes (defaultSize only applies on mount) - Change code-wrap from height:100% to flex:1 on mobile so it shares space with the Resizable instead of stealing it all - Reset pre.shiki min-height to 0 on mobile to avoid forcing the code panel tall
1 parent 91b0920 commit 9f6ddfc

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/example-preview/components/index.module.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,18 +157,18 @@
157157
width: 100% !important;
158158
}
159159
pre.shiki {
160-
min-height: 371px !important;
160+
min-height: 0 !important;
161161
}
162162
}
163163
.code-view-container-tab-show {
164164
:global {
165165
pre.shiki {
166-
min-height: 324px !important;
166+
min-height: 0 !important;
167167
}
168168
}
169169
}
170170
.code-wrap {
171-
height: 100%;
171+
flex: 1;
172172
min-height: 0;
173173
}
174174
.preview-wrap .qrcode {
@@ -199,18 +199,18 @@
199199
width: 100% !important;
200200
}
201201
pre.shiki {
202-
min-height: 371px !important;
202+
min-height: 0 !important;
203203
}
204204
}
205205
.code-view-container-tab-show {
206206
:global {
207207
pre.shiki {
208-
min-height: 324px !important;
208+
min-height: 0 !important;
209209
}
210210
}
211211
}
212212
.code-wrap {
213-
height: 100%;
213+
flex: 1;
214214
min-height: 0;
215215
}
216216
.preview-wrap .qrcode {

src/example-preview/components/resizable.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const ResizableContainer = ({
1414
if (vertical) {
1515
return (
1616
<Resizable
17+
key="vertical"
1718
style={{
1819
display: show ? 'block' : 'none',
1920
}}
@@ -66,6 +67,7 @@ export const ResizableContainer = ({
6667

6768
return (
6869
<Resizable
70+
key="horizontal"
6971
style={{
7072
display: show ? 'block' : 'none',
7173
}}

0 commit comments

Comments
 (0)