Skip to content

Datepicker does not scroll #7903

Closed
Closed
@nathanmerrill

Description

@nathanmerrill

Preconditions

On Magento 2.1.1
Chrome on Linux Mint

Steps to reproduce

I'm using the tier pricing, but I imagine this occurs in other locations on the admin side.

  1. Create the following class

use Magento\Framework\Stdlib\ArrayManager;
use Magento\Ui\DataProvider\Modifier\ModifierInterface;
class DateRangeTier implements ModifierInterface
{
    protected $arrayManager;
    
    public function __construct(ArrayManager $arrayManager) {
        $this->arrayManager = $arrayManager;
    }
    
    public function modifyMeta(array $meta)
    {
        $tierPricePath = $this->arrayManager->findPath('tier_price', $meta, null, 'children');
        if ($tierPricePath) {
            $meta = $this->arrayManager->merge(
                $tierPricePath,
                $meta,
                $this->getTierPriceStructure()
            );
        }
        return $meta;
    }
    
    public function modifyData(array $data){return $data;}
    
    protected function getTierPriceStructure()
    {
        return [
            'children' => [
                'record' => [
                    'children' => [
                        'start_date' => [
                            'arguments' => [
                                'data' => [
                                    'config' => [
                                        'dataType' => 'date,
                                        'formElement' => 'date',
                                        'componentType' => 'field',
                                        'label' => __('Start Date'),
                                        'dataScope' => 'start_date',
                                    ],
                                ],
                            ],
                        ],
                        'end_date' => [
                            'arguments' => [
                                'data' => [
                                    'config' => [
                                        'dataType' => 'date',
                                        'formElement' => 'date',
                                        'componentType' => 'field',
                                        'label' => __('End Date'),
                                        'dataScope' => 'end_date',
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ];
    }

  1. Add the class to your etc/adminhtml/di.xml:
<virtualType name="Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Pool" type="Magento\Ui\DataProvider\Modifier\Pool">
        <arguments>
            <argument name="modifiers" xsi:type="array">
                <item name="subscriptionPricing" xsi:type="array">
                    <item name="class" xsi:type="string">Path\To\DateRangeTier</item>
                    <item name="sortOrder" xsi:type="number">95</item>
                </item>
            </argument>
        </arguments>
    </virtualType>
  1. Edit a product, and select Advanced Pricing. Add a Tier, and scroll right.

Expected result

The datepicker should scroll with the fields.

Actual result

The datepicker does not scroll with the rest of the fields. (I have more fields than the ones listed above, and so they cover up other fields).

Screenshot:
screenshot_2016-12-20_10-41-27

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: FrontendFixed in 2.1.xThe issue has been fixed in 2.1 release lineFixed in 2.2.xThe issue has been fixed in 2.2 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releasebug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions