UNPKG

641 BJavaScriptView Raw
1/*
2 * Copyright (c) 2018, salesforce.com, inc.
3 * All rights reserved.
4 * SPDX-License-Identifier: MIT
5 * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6 */
7// Patch missing HTMLElement.prototype.draggable property in JSDOM.
8// Issue: https://github.com/jsdom/jsdom/issues/2268
9if (!('draggable' in HTMLElement.prototype)) {
10 Object.defineProperty(HTMLElement.prototype, 'draggable', {
11 get() {
12 return this.getAttribute('draggable');
13 },
14 set(value) {
15 this.setAttribute('draggable', value);
16 },
17 configurable: true,
18 });
19}