Skip to content

Commit fe8e06c

Browse files
authored
Merge pull request #28 from AzizKHAN030/m244_advPricing-datePicker
fixed datepicker position in admin for produc edit advanced pricing
2 parents ca86496 + 4988737 commit fe8e06c

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/view/adminhtml/layout/default.xml

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
-->
1111
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1212
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
13+
<head>
14+
<script src="ScandiPWA_Customization::js/datepicker.js"/>
15+
</head>
1316
<body>
1417
<referenceBlock name="version">
1518
<action method="setTemplate">
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
});

0 commit comments

Comments
 (0)