Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mantinedev/mantine
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Nov 17, 2022
2 parents c6c0691 + 9ec0524 commit ed0fa60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/src/docs/core/ScrollArea.mdx
Expand Up @@ -23,7 +23,7 @@ It is adapted to work well with light and dark color schemes and supports the fo
- `type` defines scrollbars behavior:
- `hover` – scrollbars are visible on hover
- `scroll` – scrollbars are visible on scroll
- `auto` – similar to `overflow: auto` – scrollbars are always visible whether the content is overflowing
- `auto` – similar to `overflow: auto` – scrollbars are always visible when the content is overflowing
- `always` – same as `auto` but scrollbars are always visible regardless of whether the content is overflowing
- `never` – scrollbars are always hidden
- `offsetScrollbars` – offset scrollbars with padding
Expand Down
16 changes: 10 additions & 6 deletions src/mantine-core/src/NumberInput/NumberInput.tsx
Expand Up @@ -125,6 +125,7 @@ const defaultProps: Partial<NumberInputProps> = {

export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>((props, ref) => {
const {
readOnly,
disabled,
value,
onChange,
Expand Down Expand Up @@ -400,11 +401,12 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>((props
event.preventDefault();
return;
}

if (event.key === 'ArrowUp') {
onStep(event, true);
} else if (event.key === 'ArrowDown') {
onStep(event, false);
if (!readOnly) {
if (event.key === 'ArrowUp') {
onStep(event, true);
} else if (event.key === 'ArrowDown') {
onStep(event, false);
}
}
};

Expand All @@ -422,14 +424,16 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>((props
variant={variant}
value={formatNum(tempValue)}
disabled={disabled}
readOnly={readOnly}
ref={useMergedRef(inputRef, ref)}
onChange={handleChange}
onBlur={handleBlur}
onFocus={handleFocus}
onKeyDown={handleKeyDown}
onKeyUp={handleKeyUp}
rightSection={
rightSection || (disabled || hideControls || variant === 'unstyled' ? null : controls)
rightSection ||
(disabled || readOnly || hideControls || variant === 'unstyled' ? null : controls)
}
rightSectionWidth={rightSectionWidth || theme.fn.size({ size, sizes: CONTROL_SIZES }) + 1}
radius={radius}
Expand Down

0 comments on commit ed0fa60

Please sign in to comment.