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

nag('dismiss') throws error #2996

Open
bootstrapdisruptive opened this issue Feb 10, 2024 · 1 comment
Open

nag('dismiss') throws error #2996

bootstrapdisruptive opened this issue Feb 10, 2024 · 1 comment
Labels
tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build type/bug Any issue which is a bug or PR which fixes a bug
Milestone

Comments

@bootstrapdisruptive
Copy link

bootstrapdisruptive commented Feb 10, 2024

Bug Report

The nag('dismiss') function throws error. ('stopImmediatePropagation')

Steps to reproduce

  1. Create an HTML
<script src="js/libs/jquery.min.js"></script> <script src="js/libs/semantic.min.js"></script>

User

Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
Lorem Ipsum
  1. Add a few Nags with Javascript
await addNag("Headline", "This iis the Nag Text <br> with linebreak","error");
await addNag("Headline", "This iis the Nag Text <br> with linebreak");
  async addNag(sHeadline, sContent, sClass='') {
    const oHtml = $(`
    <div class="ui nag ${sClass}" style="display: block;">
      <div class="title">${sHeadline}</div>
        <div>${sContent}</div>
      <i class="close icon"></i>
    </div>`);
    if ( $('.ui.nags').length ) {
      $('.ui.nags').append(oHtml);
    } else {
      $('<div>', {
        class: 'ui fixed nags',
      }).prependTo('body').append(oHtml);
    }

    oHtml.nag({storageMethod: 'localStorage'});
    oHtml.nag('show');
  }

  1. try to dismiss the error nags
    $('.ui.nag.error').nag('dismiss');

Expected result

The nag disappears without a JavaScript error

Actual result

semantic.min.js:11 Uncaught TypeError: Cannot read properties of undefined (reading 'stopImmediatePropagation')
at HTMLDivElement.dismiss (semantic.min.js:11:205425)
at Object.invoke (semantic.min.js:11:209606)
at HTMLDivElement. (semantic.min.js:11:209735)
at Function.each (jquery.min.js:2:3129)
at ce.fn.init.each (jquery.min.js:2:1594)
at C.fn.nag (semantic.min.js:11:204074)
at :1:20

Version

2.9.3

@bootstrapdisruptive bootstrapdisruptive added state/awaiting-investigation Anything which needs more investigation state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/bug Any issue which is a bug or PR which fixes a bug labels Feb 10, 2024
@bootstrapdisruptive bootstrapdisruptive changed the title [scope] summary of your bug nag('dismiss') throws error Feb 10, 2024
@lubber-de
Copy link
Member

Fixed by #2997

@lubber-de lubber-de added state/has-pr An issue which has a related PR open and removed state/awaiting-investigation Anything which needs more investigation state/awaiting-triage Any issues or pull requests which haven't yet been triaged labels Feb 10, 2024
@lubber-de lubber-de added this to the 2.9.4 milestone Feb 10, 2024
@lubber-de lubber-de added tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build and removed state/has-pr An issue which has a related PR open labels Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

No branches or pull requests

2 participants