How to use the @ui5/webcomponents-base/dist/events/PseudoEvents.js.isDown function in @ui5/webcomponents-base

To help you get started, we’ve selected a few @ui5/webcomponents-base examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SAP / ui5-webcomponents / packages / main / src / MultiComboBox.js View on Github external
_onkeydown(event) {
		if (isShow(event) && !this.readonly && !this.disabled) {
			event.preventDefault();
			this._togglePopover();
		}

		if (isDown(event) && this._getPopover()._isOpen && this.items.length) {
			event.preventDefault();
			const list = this.shadowRoot.querySelector(".ui5-multi-combobox-all-items-list");
			list._itemNavigation.current = 0;
			list.items[0].focus();
		}

		if (isBackSpace(event) && event.target.value === "") {
			event.preventDefault();

			const lastTokenIndex = this._tokenizer.tokens.length - 1;

			if (lastTokenIndex < 0) {
				return;
			}

			this._tokenizer.tokens[lastTokenIndex].focus();
github SAP / ui5-webcomponents / packages / main / src / Select.js View on Github external
_handleArrowNavigation(event, shouldFireEvent) {
		let nextIndex = -1;
		const isDownKey = isDown(event);
		const isUpKey = isUp(event);

		if (isDownKey || isUpKey) {
			event.preventDefault();
			if (isDownKey) {
				nextIndex = this._getNextOptionIndex();
			} else {
				nextIndex = this._getPreviousOptionIndex();
			}

			this.options[this._selectedIndex].selected = false;
			this.options[nextIndex].selected = true;
			this._selectedIndex = nextIndex === -1 ? this._selectedIndex : nextIndex;

			if (shouldFireEvent) {
				this.fireEvent("change", { selectedOption: this.options[nextIndex] });
github SAP / ui5-webcomponents / packages / main / src / Input.js View on Github external
_onkeydown(event) {
		if (isUp(event)) {
			return this._handleUp(event);
		}

		if (isDown(event)) {
			return this._handleDown(event);
		}

		if (isSpace(event)) {
			return this._handleSpace(event);
		}

		if (isEnter(event)) {
			return this._handleEnter(event);
		}

		this._keyDown = true;
	}
github SAP / ui5-webcomponents / packages / main / src / RadioButton.js View on Github external
_onkeydown(event) {
		if (isSpace(event)) {
			return event.preventDefault();
		}

		if (isEnter(event)) {
			return this.toggle();
		}

		if (isDown(event) || isRight(event)) {
			this._handleDown(event);
		}

		if (isUp(event) || isLeft(event)) {
			this._handleUp(event);
		}
	}

@ui5/webcomponents-base

UI5 Web Components: webcomponents.base

Apache-2.0
Latest version published 5 days ago

Package Health Score

90 / 100
Full package analysis