fix(datepicker): Full width datepicker on filter value select (#32064)

This commit is contained in:
Mehmet Salih Yavuz 2025-02-03 18:51:05 +03:00 committed by GitHub
parent 9e5876dc17
commit cde2d49c95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View File

@ -16,9 +16,17 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
import { DatePicker as AntdDatePicker } from 'antd-v5'; import { DatePicker as AntdDatePicker, DatePickerProps } from 'antd-v5';
import { css } from '@superset-ui/core';
export const DatePicker = AntdDatePicker; export const DatePicker = (props: DatePickerProps) => (
<AntdDatePicker
css={css`
width: 100%;
`}
{...props}
/>
);
// Disable ESLint rule to allow tsc to infer proper type for RangePicker. // Disable ESLint rule to allow tsc to infer proper type for RangePicker.
// eslint-disable-next-line prefer-destructuring // eslint-disable-next-line prefer-destructuring

View File

@ -23,7 +23,6 @@ import {
parseDttmToDate, parseDttmToDate,
BinaryAdhocFilter, BinaryAdhocFilter,
SimpleAdhocFilter, SimpleAdhocFilter,
css,
customTimeRangeDecode, customTimeRangeDecode,
computeCustomDateTime, computeCustomDateTime,
fetchTimeRange, fetchTimeRange,
@ -223,9 +222,6 @@ export default function TimeOffsetControls({
<div> <div>
<ControlHeader {...props} /> <ControlHeader {...props} />
<DatePicker <DatePicker
css={css`
width: 100%;
`}
onChange={(datetime: Dayjs) => onChange={(datetime: Dayjs) =>
onChange(datetime ? datetime.format(DAYJS_FORMAT) : '') onChange(datetime ? datetime.format(DAYJS_FORMAT) : '')
} }