Skip to content

TextInput: refactor to useDisableableInput - #2071

Open
labkey-nicka wants to merge 12 commits into
developfrom
fb_disable_text_input
Open

TextInput: refactor to useDisableableInput#2071
labkey-nicka wants to merge 12 commits into
developfrom
fb_disable_text_input

Conversation

@labkey-nicka

@labkey-nicka labkey-nicka commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Rationale

This refactors TextInput and TextAreaInput to functional components so that they can use useDisableableInput for disabled state management.

Related Pull Requests

Changes

  • Refactor TextInput, TextAreaInput and TextChoiceInput to functional components
  • Remove disableInput prop on TextInput in favor of pre-existing disabled prop
  • Generate input id rather than relying on the column's fieldKey
  • Remove declared type="number" in AmountUnitInput as it was always overridden to type="text" by TextInput.
  • TextAreaInput.onChange() updated to take name parameter (consistent with other inputs)
  • TextChoiceInput is a higher-order-component of a SelectInput which implements disabled state itself. No need for useDisableableInput.
  • Tighten interface for TextChoiceInput
  • Add unit tests (none existed previously)

if (startFocused && !didFocus && queryColumn && queryColumn.name) {
this.textInput.current?.focus();
this.setState({ didFocus: true });
export const TextInput: FC<TextInputProps> = props => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you'll note, this work leaves CheckboxInput and DatePickerInput as the only remaining implementations of DisableableInput. I plan on refactoring those separately.

this.setState({ didFocus: true });
export const TextInput: FC<TextInputProps> = props => {
// Extract DisableableInputProps, TextInputProps
const {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm targeting v26.10 for these changes so merging will hold off until at least v26.9 is branched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant