File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 10
10
-->
11
11
<page xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
12
12
xsi : noNamespaceSchemaLocation =" urn:magento:framework:View/Layout/etc/page_configuration.xsd" >
13
+ <head >
14
+ <script src =" ScandiPWA_Customization::js/datepicker.js" />
15
+ </head >
13
16
<body >
14
17
<referenceBlock name =" version" >
15
18
<action method =" setTemplate" >
Original file line number Diff line number Diff line change
1
+ //This script fixes incorrect positioning in modal datepickers.
2
+ //This file should be removed after magento fixes the datepickers.
3
+
4
+ require ( [ 'jquery' ] , ( $ ) => {
5
+ $ ( window ) . on ( 'load' , ( ) => {
6
+ const show = $ . datepicker . _showDatepicker ;
7
+ if ( show ) {
8
+ const datePicker = $ . datepicker . dpDiv ;
9
+
10
+ $ . extend ( $ . datepicker , {
11
+ _showDatepicker : ( trigger ) => {
12
+ show ( trigger ) ;
13
+
14
+ if ( $ ( trigger ) . parents ( '.modal-slide' ) . length > 0 ) {
15
+ const { top, height } = trigger . getBoundingClientRect ( ) ;
16
+ datePicker . css ( 'top' , top + height ) ;
17
+ }
18
+ } ,
19
+ } ) ;
20
+ }
21
+ } ) ;
22
+ } ) ;
You can’t perform that action at this time.
0 commit comments