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

♻️ Remove attemptChangeHeight method since it has AMP specific overflow feature #35777

Closed
wants to merge 1 commit into from

Conversation

dmanek
Copy link
Contributor

@dmanek dmanek commented Aug 23, 2021

attemptChangeHeight looks for overflow element, which is AMP specific. Removing this method so it calls the parent's i.e. BaseElement's attemptChangeHeight method.

Fixes #35760

@dmanek dmanek changed the title ♻️ Remove attemptChangeHeight since it has AMP specific overflow feature ♻️ Remove attemptChangeHeight method since it has AMP specific overflow feature Aug 23, 2021
@dmanek dmanek requested review from jridgewell and caroqliu August 23, 2021 22:29
@dmanek dmanek marked this pull request as ready for review August 23, 2021 22:38
// It's okay to disable this lint rule since we check that the restricted
// method exists.
// eslint-disable-next-line local/restrict-this-access
if (this.getOverflowElement && !this.getOverflowElement()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It checks if this.getOverFlowElement exists before calling precisely to guard against non-AMP cases: #35027 (comment)

If removing is preferred we should re-add into the AMP layers of affected components (amp-twitter, amp-facebook, amp-instagram) and update the documentation for future components.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@caroqliu thanks for the context on why this was added. Based on this comment it seems like we should not include any AMP specific code in preact base element. I'm ok either way and leave it up to you and @jridgewell to decide 🙂

@dmanek dmanek closed this Sep 13, 2021
@rsimha rsimha deleted the update-preact-base-element branch October 19, 2021 17:39
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.

Update preact/base-element to remove AMP specific features
3 participants