-
Notifications
You must be signed in to change notification settings - Fork 58
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
Issue with dropdown #67
Comments
Hi @KalaTheMother , could you please make an example in jsfiddle or something to see what is wrong. I couldn't reproduce this behaviour in my end. Cheers, |
HI @rubanraj54 I can reproduced the dropdown error if I use the bootstrapVue package instead of bootstrap. Don't know if that's the case here :-) And thank you for a very nice table. Excellent work!! :) |
Hi, Sorry for the late. Indeed, i use BootstrapVue. For now, i have not a jsfiddle, sorry. I'm agree with @allankluver, Excellent work :) |
I confirm this problem: dropdowns does not work when you use bootstrap-vue instead of Bootstrap's JS (with jQuery). As I do not want to load jQuery + Bootstrap's JS just for dropdowns, I wrote this little function to reproduce the dropdown's behavior: enableDropdowns() {
this.$el.querySelectorAll('[data-toggle="dropdown"]').forEach(($dropdownToggle) => {
const $dropdown = $dropdownToggle.nextElementSibling
let isShown = false
function setIsShown(state) {
isShown = state
$dropdown.classList.toggle('show', isShown)
}
if (!this.dropdowns.includes($dropdown)) {
this.dropdowns.push($dropdown)
$dropdownToggle.addEventListener('click', (event) => {
event.preventDefault()
setIsShown(!isShown)
})
$dropdown.addEventListener('click', (event) => {
event.preventDefault()
setIsShown(false)
})
$dropdown.clickOutsideEvent = (event) => {
const isDropdownOrChildren = $dropdown === event.target || $dropdown.contains(event.target)
const isDropdownToggleOrChildren = $dropdownToggle === event.target || $dropdownToggle.contains(event.target)
if (!isDropdownOrChildren && !isDropdownToggleOrChildren) {
setIsShown(false)
}
}
document.addEventListener('click', $dropdown.clickOutsideEvent)
}
})
} You just have to add this function to your EDIT: I already posted this workaround on another issue: #7 (comment) |
Thanks for your work, it is very useful :) .
I saw an issue on dropdown filter (select) : the dropdown still be closed, never opened (multi and single mode). Then i click on dropdown, it launch a new tab with the homepage link but nothing else.
Thanks and have a good day.
The text was updated successfully, but these errors were encountered: