File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
parts/Server/ServerFilters Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,20 @@ class MpMenuUiService implements IUiService {
4848 const meterNode = document . createElement ( 'div' ) ;
4949 meterNode . style . width = 'var(--width)' ;
5050 meterNode . style . height = 'var(--height)' ;
51+ meterNode . style . position = 'fixed' ;
52+ meterNode . style . top = '0' ;
53+ meterNode . style . left = '0' ;
54+ meterNode . style . pointerEvents = 'none' ;
55+ meterNode . style . opacity = '0' ;
56+ meterNode . style . transform = 'translate(-100%, -100%)' ;
57+ document . body . appendChild ( meterNode ) ;
5158
5259 function calculateDimensions ( bodyRect : DOMRect ) {
5360 const style = getComputedStyle ( meterNode ) ;
5461
5562 const viewportWidth = parseFloat ( style . getPropertyValue ( 'width' ) ) || bodyRect . width ;
5663 const viewportHeight = parseFloat ( style . getPropertyValue ( 'height' ) ) || bodyRect . height ;
57- // eslint-disable-next-line no-bitwise
58- const quant = viewportHeight * 0.0055 | 0 ; // prevent subpixeling
64+ const quant = viewportHeight * 0.0055 ;
5965
6066 return {
6167 viewportWidth,
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ export const ServersPage = observer(function ServersPage(props: ServersPageProps
7272 initialScrollOffset = { initialScrollOffset }
7373 className = { s . list }
7474 itemCount = { list . sequence . length }
75- itemHeight = { UiService . quant * 9 }
75+ itemHeight = { Math . ceil ( UiService . quant * 9 ) } // Ceil to avoid gaps between rows
7676 renderItem = { renderItem }
7777 />
7878 ) }
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ const FiltersPopover = observer(function FiltersPopover(props: ServerFiltersProp
196196
197197 < VirtualScrollable
198198 itemCount = { localesList . length }
199- itemHeight = { UiService . quant * 6 }
199+ itemHeight = { Math . ceil ( UiService . quant * 6 ) }
200200 renderItem = { ( index ) => (
201201 < LocaleFaucet config = { config } locale = { locales [ localesList [ index ] ] } />
202202 ) }
@@ -222,7 +222,7 @@ const FiltersPopover = observer(function FiltersPopover(props: ServerFiltersProp
222222
223223 < VirtualScrollable
224224 itemCount = { tagsList . length }
225- itemHeight = { UiService . quant * 6 }
225+ itemHeight = { Math . ceil ( UiService . quant * 6 ) }
226226 renderItem = { ( index ) => (
227227 < TagFaucet config = { config } tag = { tagsList [ index ] } count = { tags [ tagsList [ index ] ] . count } />
228228 ) }
You can’t perform that action at this time.
0 commit comments