@joewinke/jatui 0.2.22 → 0.2.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/actions/floating.js
CHANGED
|
@@ -75,6 +75,17 @@ export function floating(node, options) {
|
|
|
75
75
|
function applyPosition() {
|
|
76
76
|
if (!opts.anchor)
|
|
77
77
|
return;
|
|
78
|
+
// Anchor the element synchronously BEFORE the async computePosition
|
|
79
|
+
// refines it. computePosition resolves on a microtask, and until then a
|
|
80
|
+
// position:fixed element with auto left/top renders at its static flow
|
|
81
|
+
// position — observed in prod as a context menu stuck at the container's
|
|
82
|
+
// top-left instead of the cursor. The raw anchor rect is the correct
|
|
83
|
+
// coarse position (exact for virtual/cursor anchors); flip/shift then
|
|
84
|
+
// refine it when the promise lands.
|
|
85
|
+
const rect = opts.anchor.getBoundingClientRect();
|
|
86
|
+
node.style.position = 'fixed';
|
|
87
|
+
node.style.left = `${rect.left}px`;
|
|
88
|
+
node.style.top = `${rect.bottom + (opts.offset ?? 0)}px`;
|
|
78
89
|
const middlewares = [];
|
|
79
90
|
if (opts.offset != null)
|
|
80
91
|
middlewares.push(fuOffset(opts.offset));
|
|
@@ -87,7 +98,6 @@ export function floating(node, options) {
|
|
|
87
98
|
strategy: 'fixed',
|
|
88
99
|
middleware: middlewares,
|
|
89
100
|
}).then(({ x, y }) => {
|
|
90
|
-
node.style.position = 'fixed';
|
|
91
101
|
node.style.left = `${x}px`;
|
|
92
102
|
node.style.top = `${y}px`;
|
|
93
103
|
});
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
class:ring-success={participant.isSpeaking}
|
|
72
72
|
style="border-radius: var(--jatui-radius-box);"
|
|
73
73
|
aria-label={`${participant.name}${participant.micMuted ? ', muted' : ''}${participant.cameraOff ? ', camera off' : ''}`}
|
|
74
|
+
data-participant-id={participant.id}
|
|
74
75
|
>
|
|
75
76
|
<!-- svelte-ignore a11y_media_has_caption -->
|
|
76
77
|
<video
|