Ignore:
Timestamp:
11/25/21 22:08:24 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
8d391a1
Parents:
59329aa
Message:

primeNG components

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/node_modules/@angular/cdk/bundles/cdk-overlay.umd.js

    r59329aa re29cc2e  
    942942            _this._platform = _platform;
    943943            _this._cursorStyleIsSet = false;
     944            /** Store pointerdown event target to track origin of click. */
     945            _this._pointerDownListener = function (event) {
     946                _this._pointerDownEventTarget = i2._getEventTarget(event);
     947            };
    944948            /** Click event listener that will be attached to the body propagate phase. */
    945949            _this._clickListener = function (event) {
    946950                var target = i2._getEventTarget(event);
     951                // In case of a click event, we want to check the origin of the click
     952                // (e.g. in case where a user starts a click inside the overlay and
     953                // releases the click outside of it).
     954                // This is done by using the event target of the preceding pointerdown event.
     955                // Every click event caused by a pointer device has a preceding pointerdown
     956                // event, unless the click was programmatically triggered (e.g. in a unit test).
     957                var origin = event.type === 'click' && _this._pointerDownEventTarget
     958                    ? _this._pointerDownEventTarget : target;
     959                // Reset the stored pointerdown event target, to avoid having it interfere
     960                // in subsequent events.
     961                _this._pointerDownEventTarget = null;
    947962                // We copy the array because the original may be modified asynchronously if the
    948963                // outsidePointerEvents listener decides to detach overlays resulting in index errors inside
     
    959974                    }
    960975                    // If it's a click inside the overlay, just break - we should do nothing
    961                     // If it's an outside click dispatch the mouse event, and proceed with the next overlay
    962                     if (overlayRef.overlayElement.contains(target)) {
     976                    // If it's an outside click (both origin and target of the click) dispatch the mouse event,
     977                    // and proceed with the next overlay
     978                    if (overlayRef.overlayElement.contains(target) ||
     979                        overlayRef.overlayElement.contains(origin)) {
    963980                        break;
    964981                    }
     
    979996            if (!this._isAttached) {
    980997                var body = this._document.body;
     998                body.addEventListener('pointerdown', this._pointerDownListener, true);
    981999                body.addEventListener('click', this._clickListener, true);
    9821000                body.addEventListener('auxclick', this._clickListener, true);
     
    9961014            if (this._isAttached) {
    9971015                var body = this._document.body;
     1016                body.removeEventListener('pointerdown', this._pointerDownListener, true);
    9981017                body.removeEventListener('click', this._clickListener, true);
    9991018                body.removeEventListener('auxclick', this._clickListener, true);
Note: See TracChangeset for help on using the changeset viewer.