This is an automated email from the ASF dual-hosted git repository.
diegopucci pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new cde2d49c95 fix(datepicker): Full width datepicker on filter value
select (#32064)
cde2d49c95 is described below
commit cde2d49c95cb877cc9f4dcfa13fca2244dbb33f4
Author: Mehmet Salih Yavuz <[email protected]>
AuthorDate: Mon Feb 3 18:51:05 2025 +0300
fix(datepicker): Full width datepicker on filter value select (#32064)
---
superset-frontend/src/components/DatePicker/index.tsx | 12 ++++++++++--
.../src/explore/components/controls/TimeOffsetControl.tsx | 4 ----
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/superset-frontend/src/components/DatePicker/index.tsx
b/superset-frontend/src/components/DatePicker/index.tsx
index ed79c69e9d..a9b1f465f4 100644
--- a/superset-frontend/src/components/DatePicker/index.tsx
+++ b/superset-frontend/src/components/DatePicker/index.tsx
@@ -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
diff --git
a/superset-frontend/src/explore/components/controls/TimeOffsetControl.tsx
b/superset-frontend/src/explore/components/controls/TimeOffsetControl.tsx
index e4a446c716..655d5565fd 100644
--- a/superset-frontend/src/explore/components/controls/TimeOffsetControl.tsx
+++ b/superset-frontend/src/explore/components/controls/TimeOffsetControl.tsx
@@ -23,7 +23,6 @@ import {
parseDttmToDate,
BinaryAdhocFilter,
SimpleAdhocFilter,
- css,
customTimeRangeDecode,
computeCustomDateTime,
fetchTimeRange,
@@ -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) : '')
}