Skip to content

fix: Replace Input with outlined TextField in WizardInputs — GH#4752 - #5012

Open
properGrammar wants to merge 5 commits into
zowe:v3.x.xfrom
properGrammar:fix/gh4752-wizard-inputs-outlined
Open

properGrammar wants to merge 5 commits into
zowe:v3.x.xfrom
properGrammar:fix/gh4752-wizard-inputs-outlined

Conversation

@properGrammar

Copy link
Copy Markdown

Description

Replaces the MUI FormControl + InputLabel + Input + FormHelperText structure in WizardInputs.jsx with a single <TextField variant="outlined" />. This adds visible outer borders to static onboarding wizard input fields, making them clearly readable.

Linked to #4752

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Verified api-catalog-ui:npmTest passes cleanly (69 suites, 351 tests).
  • Verified api-catalog-ui:npmLint passes without errors.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

Signed-off-by: Graham Arthur Mackenzie <gam@Grahams-MacBook-Air.local>
Signed-off-by: Graham Arthur Mackenzie <gam@mac.mynetworksettings.com>
FormControl,
FormControlLabel,
FormHelperText,
Input, // still needed — used as base component for Select in MUI v4

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see anythig breaking when you remove this import, are you sure it's necessary?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

also FormHelperText is unused

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Regarding "I don't see anythig breaking when you remove this import, are you sure it's necessary?"

OP (@balhar-jakub) said herein Input import kept Input is still used internally by MUI's Select component in v4. Removing the import could cause subtle issues. which is why I left it in... Happy to remove it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Regarding FormHelperText being left in, I believe I did that because that's what Jakub did in his example called out herein, but I see now that he actually removed it here, so I'm happy to remove it too...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, both imports can be removed, I couldn't find anything that would need it here and lint would fail if we keep it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done; thanks.

className="wizardFormFields"
helperText={caption}
InputLabelProps={{ shrink: true }}
FormHelperTextProps={{ id: captionId }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Adding this breaks helper text helper. Remove FormHelperTextProps={{ id: captionId }} and the captionId variable. Add a test that the input's aria-describedby points to the helper text's ID.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Now that I've removed FormHelperText (see comment above), I'm happy to also remove FormHelperTextProps... Will look into adding the requested test.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Update: the correct formatting returns when both FormHelperText and FormHelperTextProps are removed, so will def keep that change. Still need to look into the requested test...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated! I've removed FormHelperTextProps and the unused captionId variable so MUI handles the ID association natively. I also added the unit test to WizardInputs.test.jsx to verify that aria-describedby links correctly to the helper text element, which is passing locally and will be included in this push.

))}
</Select>
</FormControl>
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know this was not changed in this PR, but it is related to the description in the issue:
The problem: a wizard step that has both free-text and option fields now mixes two styles:

  • Text fields: a bordered box with the label set into the top border, full width.
  • Dropdowns: the old underline only, label above, normal width, and a different class (formField).

Issue #4752 asked for clear borders around inputs, so the dropdowns don't get the fix. The step also looks less consistent than before, when everything used the underline style.

Why variant="outlined" on Select alone isn't enough: in Material-UI v4 an outlined dropdown needs three pieces set up together.

  1. FormControl variant="outlined" tells InputLabel to use the outlined label position. Without it, the label stays in the underline-style position and overlaps the border.
  2. InputLabel id=... plus Select labelId=... connects the label to the dropdown for screen readers.
  3. Select label={question} sizes the gap in the top border where the label sits. Without it, the border runs straight through the label text. Because the label is forced up with shrink, notched should also be set so the gap is there even when no value is selected.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

No worries that we're stepping outside the bounds of the original PR! Happy to address things more holistically..

I've updated the dropdown renderer to set variant="outlined", fullWidth, and className="wizardFormFields" on <FormControl/>, while passing labelId, label, and notched to <Select/>. Both text fields and dropdowns now match; will post the push asap here for your approval.

All I'm still in need of is confirmation from @balhar-jakub that Input needs to be kept in...

@properGrammar

Copy link
Copy Markdown
Author

@achmelo

Thanks for the thorough review! I've updated the PR to address all of your feedback:

  1. Cleaned up accessibility props: Removed FormHelperTextProps and the captionId variable from WizardInputs.jsx to let MUI manage aria-describedby natively.

  2. Added accessibility unit test: Added a test in WizardInputs.test.jsx verifying that aria-describedby on the input correctly points to the helper text element ID (tested and passing locally).

  3. Aligned dropdown styling: Updated dropdown rendering to set variant="outlined", fullWidth, and className="wizardFormFields" on <FormControl/>, along with labelId, label, and notched on <Select/> so free-text and option fields share the exact same bordered layout.

Like I said above, the last step for now is for @balhar-jakub / someone else to thumbs up or down the inclusion of Input.

…perText props, and add test

Signed-off-by: Graham Arthur Mackenzie <gam@Grahams-MacBook-Air.local>
@properGrammar
properGrammar force-pushed the fix/gh4752-wizard-inputs-outlined branch from d78b399 to 4e614eb Compare November 5, 2026 17:16
achmelo and others added 2 commits November 19, 2026 15:10
@properGrammar
properGrammar force-pushed the fix/gh4752-wizard-inputs-outlined branch from 90d70f1 to d03c9d4 Compare November 19, 2026 16:37
@properGrammar

Copy link
Copy Markdown
Author

@achmelo

I removed the unused Input import (d03c9d4) and verified npm run lint passes with 0 errors and no warnings in WizardInputs.jsx.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants