Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQFormAutoComplete dynamic width is not working and causing unexpected behavior #429

Closed
Chris-Boyle opened this issue Aug 17, 2021 · 0 comments · Fixed by #430
Closed

SQFormAutoComplete dynamic width is not working and causing unexpected behavior #429

Chris-Boyle opened this issue Aug 17, 2021 · 0 comments · Fixed by #430
Assignees
Labels
bug Something isn't working High Priority in progress

Comments

@Chris-Boyle
Copy link
Contributor

Chris-Boyle commented Aug 17, 2021

In this PR #372 and ticket we introduced some autocomplete drop down custom width logic. Since consuming it in Senior we are seeing some unexpected behavior with the SQFormAutoComplete drop downs.
What I think we should do is revert the PR so it doesn't block any application releases. Look at the solution again with a clean slate and find a better fix.
Autocomplete width goes wider than the modal width causing a horizontal scroll
This is without the lockWidthToField prop set to true.
image
Styles from our form/card component
image
Consumer code for the actions issue
I left out some of the additional fields but this is what I think matters. Here is the full source code link

const formMuiGridProps = {
  justify: 'space-between',
  alignItems: 'center',
};
 <SQForm
              initialValues={initialFormValues}
              validationSchema={validationSchema}
              muiGridProps={formMuiGridProps}
              onSubmit={noop}
            >
      <SQFormAutocomplete
        name="actionKey"
        label="Assign action"
        size={4}
        isRequired
        onChange={onAssignActionChange}
        displayEmpty
      >
        {actionOptions}
      </SQFormAutocomplete>
</SQForm>

Senior issues and Storybook issues: https://www.loom.com/share/0e70d6f614b84cafb7b3e3d51340ff23

I can also see some unexpected behavior in Storybook.
In our storybook this story should use the lockwidth prop to make the drop down with not wider than the field. On initial render it is not working
image
The next time the drop down is clicked it does perform correctly.

I think lockWidthToField should be default to true to make all these changes passive.

@gdoohen1 gdoohen1 added the bug Something isn't working label Aug 17, 2021
@gdoohen1 gdoohen1 self-assigned this Aug 17, 2021
gdoohen1 added a commit that referenced this issue Aug 17, 2021
autocomplete should now have the correct width on first render and then
popover should more reliably render below the field

✅ Closes: #429
SeanGroff pushed a commit that referenced this issue Aug 25, 2021
### [5.3.2](v5.3.1...v5.3.2) (2021-08-25)

### Bug Fixes

* 🐛 fixed autocomplete initial width issues and placement ([990783b](990783b)), closes [#429](#429)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working High Priority in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants