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

fix: update form-layout when its parent becomes visible #7988

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

web-padawan
Copy link
Member

Description

Fixes vaadin/flow-components#6728

This is a fix for regression from #7792: as we no longer update layout when it's hidden, let's add IntersectionObserver to check the case when it becomes visible (e.g. by hidden attribute removed from the parent element).

Type of change

  • Bugfix

Note

Can be tested with the following example:

<div hidden>
  <vaadin-form-layout>
    <div>Foo</div>
    <div>Bar</div>
  </vaadin-form-layout>
</div>

<script type="module">
  import '@vaadin/form-layout';

  document.querySelector('vaadin-form-layout').responsiveSteps = [{ columns: 1 }];

  requestAnimationFrame(() => {
    document.querySelector('div').removeAttribute('hidden');
  });
</script>

@web-padawan
Copy link
Member Author

For some reason the test related to initially set opacity: 0 fails in WebKit, I'll investigate how to fix it.

Copy link

@web-padawan web-padawan merged commit 463ecce into main Oct 18, 2024
9 checks passed
@web-padawan web-padawan deleted the fix/form-layout-hidden branch October 18, 2024 06:58
@vaadin-bot
Copy link
Collaborator

Hi @web-padawan and @web-padawan, when i performed cherry-pick to this commit to 24.4, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 463ecce
error: could not apply 463ecce... fix: update form-layout when its parent becomes visible (#7988)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

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

Successfully merging this pull request may close these issues.

FormLayout ignoring column setting
4 participants