Skip to content

Commit

Permalink
fix(datepicker): Full width datepicker on filter value select (#32064)
Browse files Browse the repository at this point in the history
  • Loading branch information
msyavuz authored Feb 3, 2025
1 parent 9e5876d commit cde2d49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 10 additions & 2 deletions superset-frontend/src/components/DatePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@
* specific language governing permissions and limitations
* 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.
// eslint-disable-next-line prefer-destructuring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
parseDttmToDate,
BinaryAdhocFilter,
SimpleAdhocFilter,
css,
customTimeRangeDecode,
computeCustomDateTime,
fetchTimeRange,
Expand Down Expand Up @@ -223,9 +222,6 @@ export default function TimeOffsetControls({
<div>
<ControlHeader {...props} />
<DatePicker
css={css`
width: 100%;
`}
onChange={(datetime: Dayjs) =>
onChange(datetime ? datetime.format(DAYJS_FORMAT) : '')
}
Expand Down

0 comments on commit cde2d49

Please sign in to comment.