Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/pmb/node_modules/@testing-library/user-event/dist/keyboard/plugins/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.keydownBehavior = void 0;
var _utils = require("../../utils");
/**
* This file should contain behavior for arrow keys as described here:
* https://w3c.github.io/uievents-code/#key-arrowpad-section
*/
const keydownBehavior = [{
// TODO: implement for contentEditable
matches: (keyDef, element) => (keyDef.key === 'ArrowLeft' || keyDef.key === 'ArrowRight') && (0, _utils.isElementType)(element, ['input', 'textarea']),
handle: (keyDef, element) => {
var _ref;
const {
selectionStart,
selectionEnd
} = (0, _utils.getSelectionRange)(element);
const direction = keyDef.key === 'ArrowLeft' ? -1 : 1;
const newPos = (_ref = selectionStart === selectionEnd ? (selectionStart != null ? selectionStart :
/* istanbul ignore next */
0) + direction : direction < 0 ? selectionStart : selectionEnd) != null ? _ref :
/* istanbul ignore next */
0;
(0, _utils.setSelectionRange)(element, newPos, newPos);
}
}];
exports.keydownBehavior = keydownBehavior; |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.004 ]-- |