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

bulma.js as recently merged in #31raises an error in JS console #32

Open
thothal opened this issue Nov 12, 2020 · 5 comments
Open

bulma.js as recently merged in #31raises an error in JS console #32

thothal opened this issue Nov 12, 2020 · 5 comments

Comments

@thothal
Copy link

thothal commented Nov 12, 2020

bulma.js (updated in #31) is raising an error as can be seen in the JS console:

bulma.js:1 Uncaught TypeError: Cannot read property 'addEventListener' of null
at t.value (bulma.js:1)
at new t (bulma.js:1)
at a. [as navbar] (bulma.js:1)
at bulma.js:1
at Function.a.each (bulma.js:1)
at Function.value (bulma.js:1)
at bulma.js:1
at Function.a.each (bulma.js:1)
at Function.a.parseDocument (bulma.js:1)
at HTMLDocument. (bulma.js:1)

@thothal thothal changed the title bulma.js as recently merged in #31 bulma.js as recently merged in #31raises an error in JS console Nov 12, 2020
@DivadNojnarg
Copy link
Member

Could you show the code to capture that error?

@thothal
Copy link
Author

thothal commented Nov 12, 2020

Took a while to track the error down, but here is a minimal reprex:

library(shiny)
library(shinybulma)
shinyApp(bulmaPage(bulmaNavbar()), function(...) {})

So it is the bulmaNavbar item.

@DivadNojnarg
Copy link
Member

bulmaJS has an API for navbar. It's probably conflicting with the current implementation. By the way I don't manage to access to the bulmaJS doc anymore. I'll check later ;)

@thothal
Copy link
Author

thothal commented Nov 12, 2020

I tried that already, this is not the case. My guess is that bulmaJS requires a .navbar-burger and in abseince raises this error.

Try:

shinyApp(
   bulmaPage(
      bulmaNavbar(
         bulmaNavbarBurger()
      )
   ), function(...) {}
)

and the error is gone.

@DivadNojnarg
Copy link
Member

In many template I’v seen, the burger is included in the navbar template by default, only shown when screen size reaches a specific threshold. bulmaNavbarBurger should be internal to the template and not exported to the end user. As you mentioned, this would fix the issue.

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