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

Add margin option to auto resizer #1542

Open
AndrewLeedham opened this issue Jun 20, 2023 · 4 comments
Open

Add margin option to auto resizer #1542

AndrewLeedham opened this issue Jun 20, 2023 · 4 comments

Comments

@AndrewLeedham
Copy link

It would be useful to provide margin to be added to the size calculated by the auto resizer in Contentful Apps. For example using the forma-36 Autocomplete component with the auto resizer the shadow is cut-off:
image
Adding 5-10px of margin here would solve the issue.

When using @contentful/react-apps-toolkit it would look something like this:

function Component() {
  useAutoResizer({ absoluteElements: true, margin: 10 });
}
@mgoudy91
Copy link
Contributor

Hey @AndrewLeedham I'll bring this up with the team and see if we can do something like this

@mgoudy91
Copy link
Contributor

Just to make sure, you've tried using something like
sdk.window.startAutoResizer({ absoluteElements: true }); ?

It sounds like you have, but I thought I'd drop the snippet as it's a not well-documented feature of the sdk.

@AndrewLeedham
Copy link
Author

@mgoudy91 Yes I am actively using absoluteElements: true as your <Autocomplete/> component positions the dropdown absolutely.

@mgoudy91
Copy link
Contributor

@mgoudy91 Yes I am actively using absoluteElements: true as your <Autocomplete/> component positions the dropdown absolutely.

Sounds good, I'll have this thread updated when the long term fix is in place

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

No branches or pull requests

2 participants