Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_onHeaderItemKeyDown(event) {
if (isEnter(event)) {
this._onHeaderItemSelect(event);
}
// Prevent Scrolling
if (isSpace(event)) {
event.preventDefault();
}
}
}
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] });
}
}
if (isEscape(event)) {
this._escapePressed = true;
}
if (isEnter(event) || isSpace(event)) {
this._shouldClosePopover = true;
}
}
this.deactivateByKey = event => {
if (isEnter(event)) {
this.deactivate();
}
};
_onkeydown(event) {
if (isSpace(event) || isEnter(event)) {
const showPickerButton = event.target.getAttribute("data-sap-show-picker");
if (showPickerButton) {
this[`_show${showPickerButton}Picker`]();
}
}
}
_onkeyup(event) {
if (isSpace(event) || isEnter(event)) {
this.deactivate();
}
if (isSpace(event)) {
this.fireItemPress(event);
}
}
_onkeydown(event) {
super._onkeydown(event);
const itemActive = this.type === ListItemType.Active;
if (isSpace(event)) {
event.preventDefault();
}
if ((isSpace(event) || isEnter(event)) && itemActive) {
this.activate();
}
if (isEnter(event)) {
this.fireItemPress(event);
}
}
_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;
}
_onkeydown(event) {
super._onkeydown(event);
const itemActive = this.type === ListItemType.Active;
if (isSpace(event)) {
event.preventDefault();
}
if ((isSpace(event) || isEnter(event)) && itemActive) {
this.activate();
}
if (isEnter(event)) {
this.fireItemPress(event);
}
}
_onkeyup(event) {
if (isSpace(event) || isEnter(event)) {
this.active = false;
}
}
_onkeydown(event) {
if (isEnter(event)) {
return this._handleEnter(event);
}
if (isSpace(event)) {
return this._handleSpace(event);
}
}