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

Dropdown is not visible because attached behind all app elements #8

Closed
shershen08 opened this issue Dec 19, 2017 · 12 comments
Closed

Comments

@shershen08
Copy link

Due to this https://github.com/stfalcon-studio/stf-vue-select/blob/master/src/components/stf-select/StfSelect.vue#L89 the wrapper for the dropdown in attached to the DOM as the last element and may be not visible , for example when the some other popup is used.

screenshot from 2017-12-19 18-04-30

Maybe that could be better either to attach in front or have an option where to attach it (simmilar to #5 )

@shershen08
Copy link
Author

Fix is

  • in CSS add to .stf-select__options.stf-select-options {z-index: 9999;}
  • replace appending code with document.body.insertBefore(this.__selectOptionsWrapEl, document.body.childNodes[1])

@AndreySyagrovskiy
Copy link
Contributor

@shershen08 .stf-select__options.stf-select-options {z-index: 9999;} maybe it is enough? And you can add it as custom css of your site without changing the library, cause your solution is good but it is not all time suitable.

@shershen08
Copy link
Author

CSS part of the solution - you are right one can add in the application styles.
But the main problem is the position of the node in DOM, it's literally behind everything else. That's why adding it on top (or giving an option to do that may come handy).
I'll try to create a demo today and share with you

@AndreySyagrovskiy
Copy link
Contributor

@shershen08 ok thank. I am looking forward your demo.

@shershen08
Copy link
Author

here's a repo with a problem demo - https://github.com/shershen08/demo-stf-select-bug
in https://github.com/shershen08/demo-stf-select-bug/blob/master/src/App.vue I've added 2 variants of the select element , one in main part of the page, another in modal, that once can't be properly used

@AndreySyagrovskiy
Copy link
Contributor

AndreySyagrovskiy commented Dec 28, 2017

@shershen08 Thank you for demo, but z-index works in your case and document.body.insertBefore(this.__selectOptionsWrapEl, document.body.childNodes[1]) does not work. Maybe css is enough in your case.

@shershen08
Copy link
Author

Hmm, strange, I'll check one again asap
Because in the real work app I had setup exactly as reproduced and z-index wasn't enough.

@AndreySyagrovskiy
Copy link
Contributor

@shershen08 What is your browser? Is it all browsers or only one?
?

@shershen08
Copy link
Author

it's about Chrome/FF

@AndreySyagrovskiy
Copy link
Contributor

I add style and all worked to https://github.com/shershen08/demo-stf-select-bug

.stf-select_opened .stf-select__options {
z-index: 101;
}

@AndreySyagrovskiy
Copy link
Contributor

@shershen08 check please

@shershen08
Copy link
Author

Yes, it works. It's was my setup issue I guess.

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

2 participants