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: 🐛 handle content changes with overflow #144

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

shaharkazaz
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines: CONTRIBUTING.md#commit
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[ ] No

Other information

@stackblitz
Copy link

stackblitz bot commented Sep 4, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

// Don't access the `offsetWidth` multipe times since it triggers layout updates.
export function contentChange$(host: HTMLElement) {
return new Observable((subscriber) => {
const observer = new MutationObserver(() => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run outside zone

return merge(
overflowChanges(this.host),
// We need to handle cases where the host has a static width but the content might change
this.contentChanged.asObservable().pipe(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need it always or it can be set via input?

@shaharkazaz shaharkazaz force-pushed the fix/handle-content-changes-with-overflow branch 2 times, most recently from 7140f44 to f5bdb35 Compare September 5, 2023 10:34
@shaharkazaz shaharkazaz force-pushed the fix/handle-content-changes-with-overflow branch from f5bdb35 to ef3264b Compare September 5, 2023 10:36
@shaharkazaz shaharkazaz merged commit 9ba1c91 into master Sep 5, 2023
2 checks passed
@shaharkazaz shaharkazaz deleted the fix/handle-content-changes-with-overflow branch September 5, 2023 12:18
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

Successfully merging this pull request may close these issues.

2 participants