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

overflow if position absolute #12

Open
reslear opened this issue Mar 4, 2020 · 4 comments
Open

overflow if position absolute #12

reslear opened this issue Mar 4, 2020 · 4 comments

Comments

@reslear
Copy link

reslear commented Mar 4, 2020

please add option to change css overflow
Снимок экрана 2020-03-04 в 15 11 19

@stayacid
Copy link

stayacid commented Mar 5, 2020

@reslear You can bind class with style "overflow: visible!important;" to your data, responsible for displaying v-show-slide. Refering to examples for this component:
<ul id="features" v-show-slide="featuresOpen" class="features" :class="{ overflowed: featuresOpen }">
and in styles:
.features.overflowed { overflow: visible!important; }
BUT! it will immideately display content as soon as you press ul.features

@phegman
Copy link
Owner

phegman commented Mar 5, 2020

@stayacid is correct, overflow: hidden is needed for this to work correctly. That said, it is a fair point that I don't think overflow: hidden is needed once the item is open. I can look into changing this. In the meantime you could work around this issue by using the @slide-open-end and @slide-close-start events to add/remove a CSS class that overrides the overflow property. Something like:

.overflow-visible {
  overflow: visible !important;
}

@stayacid
Copy link

stayacid commented Mar 5, 2020

@phegman Yes, you're absolutely right. But, in my case, there is a problem if i have slide opened from the beginning, when page loaded. For example, on mobiles I want all my slides to be closed but on desktop - opened. So i've used mounted() hook to trigger style of the slide. Here's example:

    mounted() {
      let contentH = this.$el.querySelector('.features').style.height
      if (contentH === '' || contentH === 'auto') {
        this.featuresOpen = true;
      }
    },

and i've added events to slide;

      slideCloseStart() {
        this.featuresOpen = false
      },
      slideOpenEnd() {
        this.featuresOpen = true
      },

@tremendus
Copy link

tremendus commented Dec 6, 2020

@phegman I would agree with

That said, it is a fair point that I don't think overflow: hidden is needed once the item is open.

There is a problem when you have a dropdown near the end of the rolled up content, such as in a collapsible section of a form - when overflow: hidden is set, the drop down is cut off at the bottom.

Suggest removing overflow-hidden at the end of the transition to solve this.

My solution for now is to use the close-start and open-end events to toggle this style property:

//- element w/ directive attached
@slide-open-end='onSlideOpenEnd'
@slide-close-start='onSlideCloseStart'

//- view methods
    onSlideOpenEnd () {
      this.$refs.rollupContent.style.overflow = 'visible'
    },

    onSlideCloseStart () {
      this.$refs.rollupContent.style.overflow = 'hidden'
    }

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

4 participants