accessible-graphs icon indicating copy to clipboard operation
accessible-graphs copied to clipboard

TypeError: `$(...).modal` is not a function

Open S0AndS0 opened this issue 5 years ago • 2 comments

I've been doing some tests and bug hunting on GitHub Pages, and found that clicking the Language a tag within wonder-nav-ul unordered list causes the following JavaScript console error to be logged...

TypeError: $(...).modal is not a function

... I've tracked this down to to ts/js/scripts.ts line 83...

// open language pop-up
$('.language-click').click(() => {
  // @ts-ignore: Property 'modal' does not exist on type 'JQuery<HTMLElement>'
  $('#language-popup').modal('toggle');
});

... and it seems as though TypeScript errors/warnings where legit; there is no modal on the element/object that JQuery returns.

I'm willing to remove this dependency on JQuery and submit a Pull Request if anyone on the team is able to let me know that the intended behavior of this call is.

S0AndS0 avatar May 21 '20 03:05 S0AndS0

Does this console error happen in master or only on the GitHub Pages branch? If it only happens there then I think we can choose this issue as it currently works on master.

oferb avatar May 26 '20 09:05 oferb

Feel free to double check my results on both versions. But I'm pretty sure I tested on both, and that errors happen on both, also TypeScript complains about that method not existing on the JQuery object... so this is likely a bug.

S0AndS0 avatar May 27 '20 00:05 S0AndS0