8
0
Pārlūkot izejas kodu

getPositionedAncestor() PoC using HTMLElement.offsetParent.

Aleksander Nowodzinski 5 gadi atpakaļ
vecāks
revīzija
ec77cf41f2

+ 16 - 0
packages/ckeditor5-utils/src/dom/getpositionedancestor.js

@@ -26,3 +26,19 @@ export default function getPositionedAncestor( element ) {
 
 	return null;
 }
+
+// export default function getPositionedAncestor( element ) {
+// 	if ( !element || !element.parentNode ) {
+// 		return null;
+// 	}
+
+// 	if ( element.style.position && element.style.position !== 'static' ) {
+// 		return element;
+// 	}
+
+// 	if ( element.offsetParent === global.document.body ) {
+// 		return null;
+// 	}
+
+// 	return element.offsetParent;
+// }