MCPcopy
hub / github.com/ampproject/amphtml / getOverflowElement

Method getOverflowElement

src/custom-element.js:2077–2090  ·  view source on GitHub ↗

* Returns an optional overflow element for this custom element. * @return {?Element}

()

Source from the content-addressed store, hash-verified

2075 * @return {?Element}
2076 */
2077 getOverflowElement() {
2078 if (this.overflowElement_ === undefined) {
2079 this.overflowElement_ = query.childElementByAttr(this, 'overflow');
2080 if (this.overflowElement_) {
2081 if (!this.overflowElement_.hasAttribute('tabindex')) {
2082 this.overflowElement_.setAttribute('tabindex', '0');
2083 }
2084 if (!this.overflowElement_.hasAttribute('role')) {
2085 this.overflowElement_.setAttribute('role', 'button');
2086 }
2087 }
2088 }
2089 return this.overflowElement_;
2090 }
2091
2092 /**
2093 * Hides or shows the overflow, if available. This function must only

Callers 1

overflowCallbackMethod · 0.95

Calls 1

setAttributeMethod · 0.45

Tested by

no test coverage detected