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

AutoCrud with noNewButton renders wrong when nothing is selected #3334

Closed
Legioth opened this issue Mar 7, 2025 · 4 comments · Fixed by #3335
Closed

AutoCrud with noNewButton renders wrong when nothing is selected #3334

Legioth opened this issue Mar 7, 2025 · 4 comments · Fixed by #3335
Assignees
Labels
bug Something isn't working hilla Issues related to Hilla

Comments

@Legioth
Copy link
Member

Legioth commented Mar 7, 2025

Describe the bug

An AutoCrud with noNewButton loses the outer border and reduces the width of the grid when no item is selected.

With an item selected
Image

Without selection
Image

Expected-behavior

Expected that rendering remains consistent

Reproduction

return (
  <>
    <VerticalLayout className="p-m gap-m">
      <AutoCrud service={HelloWorldService} noNewButton model={PersonModel} />
    </VerticalLayout>
  </>
);

System Info

Vaadin 24.7.0.beta2

@Legioth Legioth added bug Something isn't working hilla Issues related to Hilla labels Mar 7, 2025
@Legioth
Copy link
Member Author

Legioth commented Mar 7, 2025

The narrower grid looks similar to what's reported in #3323 even tough additionally the border is also missing.

@cromoteca cromoteca self-assigned this Mar 8, 2025
@cromoteca
Copy link
Contributor

Can also happen with the New Button enabled, it depends on the window size:
Image

<section className="flex flex-col p-m gap-m">
  <AutoCrud service={VetService} model={VetModel} noNewButton />
</section>

works fine instead, with or without "New" button, no matter the window size.

@Legioth
Copy link
Member Author

Legioth commented Mar 10, 2025

Can also happen with the New Button enabled, it depends on the window size

Yes. That what #3323 covers. But there's one key difference: the window size case doesn't also remove the border. We can treat the width issues as part of #3323 and focus only on the border in this issue.

There's no issue with the width in a layout context where the AutoCRUD is stretched to fit all available space but it becomes visible if using its natural width. This is maybe not a realistic "real" use case but it easily happens when you start using it and gives a broken impression.

@cromoteca
Copy link
Contributor

Created #3335. It makes things more consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hilla Issues related to Hilla
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants