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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions src/preact/base-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,22 +369,6 @@ export class PreactBaseElement extends BaseElement {
}
}

/** @override */
attemptChangeHeight(newHeight) {
return super.attemptChangeHeight(newHeight).catch((e) => {
// 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 🙂

console./* OK */ warn(
'[overflow] element not found. Provide one to enable resizing to full contents.',
this.element
);
}
throw e;
});
}

/**
* @protected
* @param {!JsonObject} props
Expand Down