Skip to content

Commit eaf28e8

Browse files
committed
make sure that searching doesn't make height jumps
1 parent 82df698 commit eaf28e8

File tree

4 files changed

+36
-31
lines changed

4 files changed

+36
-31
lines changed

packages/browser-sdk/src/toolbar/Flags.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,14 @@
5050
}
5151
}
5252

53-
.flag-empty-cell {
54-
width: 100%;
53+
.flags-table-empty {
54+
position: absolute;
55+
top: 0;
56+
left: 0;
57+
right: 0;
5558
color: var(--gray500);
56-
padding: 6px 0;
59+
padding: 12px 12px;
60+
line-height: 1.5;
5761
}
5862

5963
.flag-name-cell {

packages/browser-sdk/src/toolbar/Flags.tsx

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { h } from "preact";
1+
import { Fragment, h } from "preact";
22

33
import { Switch } from "./Switch";
44
import { FlagItem } from "./Toolbar";
@@ -49,32 +49,31 @@ export function FlagsTable({
4949
});
5050

5151
return (
52-
<table class="flags-table" style={{ "--n": searchedFlags.length }}>
53-
<tbody>
54-
{(!hasFlags || !hasShownFlags) && (
55-
<tr>
56-
<td class="flag-empty-cell" colSpan={3}>
57-
No flags {hasFlags ? `matching "${searchQuery} "` : ""}
58-
found
59-
</td>
60-
</tr>
61-
)}
62-
{searchedFlags.map((flag, index) => (
63-
<FlagRow
64-
key={flag.flagKey}
65-
appBaseUrl={appBaseUrl}
66-
flag={flag}
67-
index={index}
68-
isNotVisible={
69-
searchQuery !== null && !isFound(flag.flagKey, searchQuery)
70-
}
71-
setEnabledOverride={(override) =>
72-
setIsEnabledOverride(flag.flagKey, override)
73-
}
74-
/>
75-
))}
76-
</tbody>
77-
</table>
52+
<Fragment>
53+
{(!hasFlags || !hasShownFlags) && (
54+
<div class="flags-table-empty">
55+
No flags {hasFlags ? `matching "${searchQuery}"` : "found"}
56+
</div>
57+
)}
58+
<table class="flags-table">
59+
<tbody>
60+
{searchedFlags.map((flag, index) => (
61+
<FlagRow
62+
key={flag.flagKey}
63+
appBaseUrl={appBaseUrl}
64+
flag={flag}
65+
index={index}
66+
isNotVisible={
67+
searchQuery !== null && !isFound(flag.flagKey, searchQuery)
68+
}
69+
setEnabledOverride={(override) =>
70+
setIsEnabledOverride(flag.flagKey, override)
71+
}
72+
/>
73+
))}
74+
</tbody>
75+
</table>
76+
</Fragment>
7877
);
7978
}
8079

packages/browser-sdk/src/toolbar/Toolbar.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
0 0 0 1px var(--border-color);
104104
border-radius: 7px;
105105
z-index: 999999;
106-
min-width: 220px;
106+
min-width: 240px;
107107
padding: 0;
108108

109109
--visible-flags: 15;
@@ -127,6 +127,7 @@
127127

128128
&::-webkit-scrollbar {
129129
width: 8px;
130+
height: 8px;
130131
}
131132
&::-webkit-scrollbar-track {
132133
background: transparent;

packages/browser-sdk/src/ui/Dialog.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,6 @@
125125
}
126126

127127
.dialog-content {
128+
position: relative;
128129
padding: 7px 12px;
129130
}

0 commit comments

Comments
 (0)