Skip to content

Commit 61636a0

Browse files
committed
Handle position-anchor first to reflect order from spec
1 parent eb326b8 commit 61636a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/parse.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,14 +470,14 @@ async function getAnchorEl(
470470
const customPropName = anchorObj.customPropName;
471471
if (targetEl && !anchorName) {
472472
const anchorAttr = targetEl.getAttribute('anchor');
473-
if (customPropName) {
473+
if (targetEl.dataset[POSITION_ANCHOR_DATASET_KEY]) {
474+
anchorName = targetEl.dataset[POSITION_ANCHOR_DATASET_KEY];
475+
} else if (customPropName) {
474476
anchorName = getCSSPropertyValue(targetEl, customPropName);
475477
} else if (anchorAttr) {
476478
return await validatedForPositioning(targetEl, [
477479
`#${CSS.escape(anchorAttr)}`,
478480
]);
479-
} else if (targetEl.dataset[POSITION_ANCHOR_DATASET_KEY]) {
480-
anchorName = targetEl.dataset[POSITION_ANCHOR_DATASET_KEY];
481481
}
482482
}
483483
const anchorSelectors = anchorName ? anchorNames[anchorName] ?? [] : [];

0 commit comments

Comments
 (0)