Skip to content

Carousel not closed properly after route change  #206

Closed
@digital-codes

Description

@digital-codes

Before opening:

Bug reports must include:

OS: Linux Fedora 35, Firefox 99.0.1
@coreui/vue": "^4.3.0",
"@coreui/coreui": "4.0.0",

Using CCarousel. Leaving page throws error "element is null" in function isVisible$1, @coreui/vue/dist/index.es.js
Reason is missing "null" check
Please insert check at @coreui/vue/src/components/carousel/CCarousel.ts like

const isVisible = (element: HTMLDivElement) => {
 // !!! new ----------
  if ((element || "") === "") return false
  // !!! ---------------
  const rect = element.getBoundingClientRect()
  return (
    rect.top >= 0 &&
    rect.left >= 0 &&
    rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
    rect.right <= (window.innerWidth || document.documentElement.clientWidth)
  )
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions