This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 95694aa233dd65b11116a0d0f48fc7e949b41ac4
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)
    
    (cherry picked from commit cde2d49c95cb877cc9f4dcfa13fca2244dbb33f4)
---
 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) : '')
         }

Reply via email to