fix(ui) - dropdown fixes

This commit is contained in:
Shekar Siri 2022-06-22 18:33:32 +02:00
parent d7e680247d
commit b38fbe1a30
2 changed files with 7 additions and 5 deletions

View file

@ -24,8 +24,8 @@ function WidgetSessions(props: Props) {
const filter = useObserver(() => dashboardStore.drillDownFilter);
const widget: any = useObserver(() => metricStore.instance);
// const drillDownPeriod = useObserver(() => dashboardStore.drillDownPeriod);
const startTime = DateTime.fromMillis(filter.startTimestamp).toFormat('LLL dd, yyyy HH:mm a');
const endTime = DateTime.fromMillis(filter.endTimestamp).toFormat('LLL dd, yyyy HH:mm a');
const startTime = DateTime.fromMillis(filter.startTimestamp).toFormat('LLL dd, yyyy HH:mm');
const endTime = DateTime.fromMillis(filter.endTimestamp).toFormat('LLL dd, yyyy HH:mm');
// const [timestamps, setTimestamps] = useState<any>({
// startTimestamp: 0,
// endTimestamp: 0,
@ -79,9 +79,10 @@ function WidgetSessions(props: Props) {
{ widget.metricType !== 'table' && (
<div className="flex items-center ml-6">
<span className="mr-2 color-gray-medium">Series</span>
<span className="mr-2 color-gray-medium">Filter by Series</span>
<Select
options={ seriesOptions }
defaultValue={ 'all' }
onChange={ writeOption }
plain
/>

View file

@ -13,9 +13,10 @@ interface Props {
styles?: any;
onChange: (value: any) => void;
name?: string;
placeholder?: string;
[x:string]: any;
}
export default function({ name = '', onChange, right = false, plain = false, options, isSearchable = false, components = {}, styles = {}, defaultValue = '', ...rest }: Props) {
export default function({ placeholder='Select', name = '', onChange, right = false, plain = false, options, isSearchable = false, components = {}, styles = {}, defaultValue = '', ...rest }: Props) {
const defaultSelected = defaultValue ? (options.find(o => o.value === defaultValue) || options[0]): null;
const customStyles = {
option: (provided: any, state: any) => ({
@ -133,7 +134,7 @@ export default function({ name = '', onChange, right = false, plain = false, opt
}
})}
blurInputOnSelect={true}
// menuPosition="fixed"
placeholder={placeholder}
{...rest}
/>
);