Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resize-observer div doesn't have the data attribute #1041

Open
badalsaibo opened this issue Jun 14, 2024 · 0 comments
Open

resize-observer div doesn't have the data attribute #1041

badalsaibo opened this issue Jun 14, 2024 · 0 comments

Comments

@badalsaibo
Copy link

badalsaibo commented Jun 14, 2024

<template>
  <Dropdown v-bind="$attrs">
    <slot></slot>
    <template #popper="slotProps">
      <slot name="content" v-bind="slotProps"></slot>
    </template>
  </Dropdown>
</template>

<script lang="ts" setup>
import { Dropdown } from 'floating-vue';
import 'floating-vue/dist/style.css';
</script>

For this component using in two different pages. For first page, the resize-observer class has the id generated on it.

Screenshot 2024-06-14 at 4 10 15 PM

But on a second page i.e a new route. The id isn't attached on the resize-observer

Screenshot 2024-06-14 at 4 11 36 PM

Why is the id important?

Because the base styles import 'floating-vue/dist/style.css' apply some styles to the resize-observor based on the data attribute, which is crucial for positioning of the dropdown.

.resize-observer[data-v-b329ee4c]{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%;border:none;background-color:transparent;pointer-events:none;display:block;overflow:hidden;opacity:0}

https://unpkg.com/floating-vue@2.0.0/dist/style.css

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant