Skip to content

Commit

Permalink
Merge pull request #1485 from colouring-cities/number-input-fixes
Browse files Browse the repository at this point in the history
Fix for number input fields
  • Loading branch information
mdsimpson42 authored Feb 7, 2025
2 parents 8f97164 + 897dc5a commit ebc2c17
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

input[type=number]{
-moz-appearance: textfield;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { Fragment } from 'react';
import { BaseDataEntryProps } from './data-entry';
import { DataTitleCopyable } from './data-title';

import './numeric-data-entry.css';

interface NumericDataEntryProps extends BaseDataEntryProps {
value?: number;
Expand All @@ -28,6 +29,7 @@ const NumericDataEntry: React.FunctionComponent<NumericDataEntryProps> = (props)
<input
className="form-control"
type="number"
onWheel={(e) => (e.target as HTMLElement).blur()}
id={slugWithModifier}
name={slugWithModifier}
value={props.value == undefined ? '' : props.value}
Expand Down

0 comments on commit ebc2c17

Please sign in to comment.