on master help sign in
fix: update input disabled behavior/styling
c626d94Matt Condon (shrugs)
src/indigo-react/components/Input.js+4−3
@@ -129,11 +129,12 @@ export default function Input({
129 autoFocus = false,
129 autoFocus = false,
130 ...rest
130 ...rest
131}) {
131}) {
132+ const actuallyAutoFocus = autoFocus && !disabled;
132 const { focused, pass, visiblyPassed, error, data, bind } = useInput({
133 const { focused, pass, visiblyPassed, error, data, bind } = useInput({
133 validators,
134 validators,
134 transformers,
135 transformers,
135 initialValue,
136 initialValue,
136− autoFocus,
137+ autoFocus: actuallyAutoFocus,
137 });
138 });
138
139
139 // notify parent of value only when passing
140 // notify parent of value only when passing
@@ -171,7 +172,7 @@ export default function Input({
171 { mono },
172 { mono },
172 {
173 {
173 'bg-white': !disabled,
174 'bg-white': !disabled,
174− 'bg-gray3': disabled,
175+ 'bg-gray1': disabled,
175 },
176 },
176 {
177 {
177 gray4: !focused,
178 gray4: !focused,
@@ -190,7 +191,7 @@ export default function Input({
190 }}
191 }}
191 id={name}
192 id={name}
192 name={name}
193 name={name}
193− autoFocus={autoFocus}
194+ autoFocus={actuallyAutoFocus}
194 {...bind}
195 {...bind}
195 />
196 />
196 </Grid.Item>
197 </Grid.Item>