Skip to content

Commit

Permalink
Merge pull request #959 from statisticsnorway/MIM-1690_input-name
Browse files Browse the repository at this point in the history
Add name prop to input component
  • Loading branch information
omsaggau committed Jan 23, 2024
2 parents 428b8ce + 49c8bcf commit eb85ceb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@statisticsnorway/ssb-component-library",
"version": "2.0.96",
"version": "2.0.97",
"description": "Component library for SSB (Statistics Norway)",
"main": "lib/bundle.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion src/components/Input/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import InputError from '../InputError';

const Input = forwardRef(({
role, ariaLabelWrapper, ariaLabel, ariaLabelledBy, ariaLabelSearchButton,
className, disabled, error, errorMessage, handleChange, id, label, negative, placeholder, searchField, submitCallback, type, value, onFocus, onBlur, size,
name, className, disabled, error, errorMessage, handleChange, id, label, negative, placeholder, searchField, submitCallback, type, value, onFocus, onBlur, size,
}, ref) => {
const [inputValue, setValue] = useState(value);
const inputId = id || useId();
Expand All @@ -27,6 +27,7 @@ const Input = forwardRef(({
<div ref={ref} className="input-wrapper" role={searchField ? 'search' : role} aria-label={ariaLabelWrapper}>
<input
id={inputId}
name={name}
disabled={disabled}
type={type}
value={inputValue}
Expand Down Expand Up @@ -74,6 +75,7 @@ Input.propTypes = {
ariaLabel: PropTypes.string,
ariaLabelledBy: PropTypes.string,
ariaLabelSearchButton: PropTypes.string,
name: PropTypes.string,
className: PropTypes.string,
disabled: PropTypes.bool,
error: PropTypes.bool,
Expand Down

0 comments on commit eb85ceb

Please sign in to comment.