mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-26 23:50:52 +01:00
fix chooser resize
This commit is contained in:
parent
5020f1f063
commit
4a8f738bb0
@ -1,11 +1,16 @@
|
|||||||
.nitro-chooser-widget {
|
.nitro-chooser-widget {
|
||||||
|
|
||||||
|
|
||||||
.list-item {
|
.chooser-container {
|
||||||
color: black;
|
min-height: 150px;
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
&.selected {
|
.list-item {
|
||||||
background-color: cadetblue;
|
color: black;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&.selected {
|
||||||
|
background-color: cadetblue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { FC, useCallback, useMemo, useState } from 'react';
|
import { FC, useCallback, useMemo, useState } from 'react';
|
||||||
import { List, ListRowProps, ListRowRenderer } from 'react-virtualized';
|
import { AutoSizer, List, ListRowProps, ListRowRenderer } from 'react-virtualized';
|
||||||
import { RoomObjectItem, RoomWidgetRoomObjectMessage } from '../../../../api';
|
import { RoomObjectItem, RoomWidgetRoomObjectMessage } from '../../../../api';
|
||||||
import { LocalizeText } from '../../../../api/utils';
|
import { LocalizeText } from '../../../../api/utils';
|
||||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../layout';
|
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../layout';
|
||||||
@ -53,12 +53,19 @@ export const ChooserWidgetView: FC<ChooserWidgetViewProps> = props =>
|
|||||||
<input type="text" className="form-control form-control-sm" placeholder={ LocalizeText('generic.search') } value={searchValue} onChange={event => setSearchValue(event.target.value)} />
|
<input type="text" className="form-control form-control-sm" placeholder={ LocalizeText('generic.search') } value={searchValue} onChange={event => setSearchValue(event.target.value)} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<List
|
<div className="row w-100 h-100 chooser-container">
|
||||||
width={ 150 }
|
<AutoSizer defaultWidth={150} defaultHeight={150}>
|
||||||
height={ 150 }
|
{({ height, width }) =>
|
||||||
rowCount={ filteredItems.length }
|
{
|
||||||
rowHeight={ 20 }
|
return (<List
|
||||||
rowRenderer={ rowRenderer } />
|
width={ width }
|
||||||
|
height={ height }
|
||||||
|
rowCount={ filteredItems.length }
|
||||||
|
rowHeight={ 20 }
|
||||||
|
rowRenderer={ rowRenderer } />)
|
||||||
|
}}
|
||||||
|
</AutoSizer>
|
||||||
|
</div>
|
||||||
</NitroCardContentView>
|
</NitroCardContentView>
|
||||||
</NitroCardView>
|
</NitroCardView>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user