Skip to content

Commit

Permalink
exploring
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Aug 21, 2023
1 parent 124da2b commit 911ea48
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ember-velcro/src/modifiers/velcro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ export default class VelcroModifier extends Modifier<Signature> {
assert('@middleware must be an array of one or more objects', Array.isArray(middleware));

Object.assign(floatingElement.style, {
position: 'absolute',
position: strategy,
top: '0',
left: '0',
});

let update = async () => {
let { middlewareData } = await computePosition(referenceElement, floatingElement, {
let { middlewareData, x, y } = await computePosition(referenceElement, floatingElement, {
middleware: [
offset(offsetOptions),
flip(flipOptions),
Expand All @@ -88,6 +88,10 @@ export default class VelcroModifier extends Modifier<Signature> {
strategy,
});

Object.assign(floatingElement.style, {
top: `${y}px`,
left: `${x}px`,
});
setVelcroData?.(middlewareData.metadata);
};

Expand Down

0 comments on commit 911ea48

Please sign in to comment.