Files
edx-platform/lms/static/js/demographics_collection/SelectWithInput.jsx
Syed Ali Abbas Zaidi d7053a6783 fix: eslint autofixable issues (#32181)
* fix: eslint operator-linebreak issue

* fix: eslint quotes issue

* fix: react jsx indent and props issues

* fix: eslint trailing spaces issues

* fix: eslint line around directives issue

* fix: eslint semi rule

* fix: eslint newline per chain rule

* fix: eslint space infix ops rule

* fix: eslint space-in-parens issue

* fix: eslint space before function paren issue

* fix: eslint space before blocks issue

* fix: eslint arrow body style issue

* fix: eslint dot-location issue

* fix: eslint quotes issue

* fix: eslint quote props issue

* fix: eslint operator assignment issue

* fix: eslint new line after import issue

* fix: indent issues

* fix: operator assignment issue

* fix: all autofixable eslint issues

* fix: all react related fixable issues

* fix: autofixable eslint issues

* chore: remove all template literals

* fix: remaining autofixable issues

* fix: failing js test
2023-05-18 11:03:59 +05:00

52 lines
1.3 KiB
JavaScript

import React from 'react';
export const SelectWithInput = (props) => {
const {
selectName,
selectId,
selectValue,
options,
inputName,
inputId,
inputType,
inputValue,
selectOnChange,
inputOnChange,
showInput,
inputOnBlur,
labelText,
disabled,
} = props;
return (
<div className="d-flex flex-column pb-3">
<label htmlFor={selectName}>{labelText}</label>
<select
autoFocus
className="form-control"
name={selectName}
id={selectId}
onChange={selectOnChange}
value={selectValue}
disabled={disabled}
>
{options}
</select>
{showInput
&& (
<input
className="form-control"
aria-label={`${selectName} description field`}
type={inputType}
name={inputName}
id={inputId}
onChange={inputOnChange}
onBlur={inputOnBlur}
value={inputValue}
disabled={disabled}
maxLength={255}
/>
)}
</div>
);
};