Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions packages/main/src/StepInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ class StepInput extends UI5Element implements IFormInputElement {

_onButtonFocusOut() {
setTimeout(() => {
if (!this._inputFocused) {
if (!this._inputFocused && !this.shadowRoot!.activeElement) {
this.inputOuter.removeAttribute("focused");
Comment thread
NHristov-sap marked this conversation as resolved.
}
}, 0);
Expand All @@ -507,13 +507,11 @@ class StepInput extends UI5Element implements IFormInputElement {
}

_onMouseWheel(e: WheelEvent) {
if (this.disabled || this.readonly) {
if (this.disabled || this.readonly || !this._isFocused) {
return;
}

if (this._isFocused) {
e.preventDefault();
}
e.preventDefault();

const isScrollUp = e.deltaY < 0;
const modifier = isScrollUp ? this.step : -this.step;
Expand Down Expand Up @@ -767,15 +765,25 @@ class StepInput extends UI5Element implements IFormInputElement {
return !Number.isNaN(parsedValue) && !/, {2,}/.test(typedValue);
}

_decSpin() {
_decSpin(e: MouseEvent) {
if (this._isFocused || this._decIconDisabled) {
e.preventDefault();
}
if (!this._decIconDisabled) {
this._spinValue(false, true);
} else {
this.input.focus();
}
}

_incSpin() {
_incSpin(e: MouseEvent) {
if (this._isFocused || this._incIconDisabled) {
e.preventDefault();
}
if (!this._incIconDisabled) {
this._spinValue(true, true);
} else {
this.input.focus();
}
}

Expand Down
3 changes: 2 additions & 1 deletion packages/main/src/themes/StepInput.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
box-sizing: border-box;
height: var(--_ui5_input_height);
position: relative;
isolation: isolate;
margin: var(--_ui5_input_margin_top_bottom) 0;
min-width: var(--_ui5_step_input_min_width);
text-align: right;
Expand Down Expand Up @@ -99,7 +100,7 @@
pointer-events: none;
border-radius: var(--sapField_BorderCornerRadius);
border-style: var(--_ui5_input_error_warning_border_style);
z-index: 1;
z-index: 0;
border-width: 0px;
}

Expand Down
Loading