mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TimeRangePicker: Use native scrollbar (#88327)
* Use native scrollbar * Native overflow scroll * Fix feedback * Make scrollbars thin
This commit is contained in:
parent
7e25ff5756
commit
c8ab138dbf
@ -7,7 +7,6 @@ import { selectors } from '@grafana/e2e-selectors';
|
||||
import { useStyles2, useTheme2 } from '../../../themes';
|
||||
import { getFocusStyles } from '../../../themes/mixins';
|
||||
import { t, Trans } from '../../../utils/i18n';
|
||||
import { CustomScrollbar } from '../../CustomScrollbar/CustomScrollbar';
|
||||
import { FilterInput } from '../../FilterInput/FilterInput';
|
||||
import { Icon } from '../../Icon/Icon';
|
||||
|
||||
@ -88,12 +87,10 @@ export const TimePickerContentWithScreenSize = (props: PropsWithScreenSize) => {
|
||||
placeholder={t('time-picker.content.filter-placeholder', 'Search quick ranges')}
|
||||
/>
|
||||
</div>
|
||||
<CustomScrollbar>
|
||||
{!isFullscreen && <NarrowScreenForm {...props} historyOptions={historyOptions} />}
|
||||
{!hideQuickRanges && (
|
||||
<TimeRangeList options={filteredQuickOptions} onChange={onChangeTimeOption} value={timeOption} />
|
||||
)}
|
||||
</CustomScrollbar>
|
||||
{!isFullscreen && <NarrowScreenForm {...props} historyOptions={historyOptions} />}
|
||||
{!hideQuickRanges && (
|
||||
<TimeRangeList options={filteredQuickOptions} onChange={onChangeTimeOption} value={timeOption} />
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{isFullscreen && (
|
||||
@ -295,6 +292,7 @@ const getStyles = (
|
||||
borderRight: `${isReversed ? 'none' : `1px solid ${theme.colors.border.weak}`}`,
|
||||
width: `${!hideQuickRanges ? '60%' : '100%'}`,
|
||||
overflow: 'auto',
|
||||
scrollbarWidth: 'thin',
|
||||
order: isReversed ? 1 : 0,
|
||||
}),
|
||||
rightSide: css({
|
||||
|
@ -55,6 +55,7 @@ const Options = ({ options, value, onChange, title }: Props) => {
|
||||
onKeyDown={handleKeys}
|
||||
ref={localRef}
|
||||
aria-roledescription={t('time-picker.time-range.aria-role', 'Time range selection')}
|
||||
className={styles.list}
|
||||
>
|
||||
{options.map((option, index) => (
|
||||
<TimeRangeOption
|
||||
@ -96,4 +97,8 @@ const getOptionsStyles = () => ({
|
||||
flexGrow: 1,
|
||||
alignItems: 'flex-start',
|
||||
}),
|
||||
list: css({
|
||||
overflowY: 'auto',
|
||||
scrollbarWidth: 'thin',
|
||||
}),
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user