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

Implement Portal Logic for UpWindowAngularComponent #12

Closed
lucasferreiralimax opened this issue Oct 17, 2024 · 0 comments · Fixed by #13
Closed

Implement Portal Logic for UpWindowAngularComponent #12

lucasferreiralimax opened this issue Oct 17, 2024 · 0 comments · Fixed by #13
Assignees
Labels
enhancement New feature or request hacktoberfest

Comments

@lucasferreiralimax
Copy link
Member

Currently, the UpWindowAngularComponent appends its modal element to the body using document.body.appendChild, but the component's rendering logic needs to be adjusted to remove and re-add the modal dynamically based on the isOpen state, to follow a more declarative and controlled approach.

Task:

  • Implement logic to conditionally append the modal to the body only when the isOpen signal is true.
  • Ensure the modal is removed from the DOM when isOpen is false, without leaving any dangling DOM elements.
  • Refactor the current ngAfterViewInit logic to properly manage the lifecycle of the modal element.
  • Update focus trap and keyboard interaction to remain functional after this change.

Acceptance Criteria:

  • Modal should only be appended to the DOM when it is open and fully removed when closed.
  • Focus trap, keyboard navigation (Tab, Shift+Tab, and Escape), and animations should continue to work seamlessly.
  • Confirm and cancel actions should function as before, closing the modal and removing it from the DOM.

Additional Notes:

  • This change is intended to clean up the current DOM manipulation approach and make the component's lifecycle management more predictable.
  • Please consider edge cases, such as rapid opening and closing of the modal, and ensure animations still play correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant