lindell / lindell/JsBarcode

cant render on hidden element modal.

Open
#457 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.9k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

i have a hiden modal with content like this:

```



```

i try to implement JsBarcode like this:

```
let string = "A_C01_N03"
window.JsBarcode("#bc-" + string, string, {width: 6, height: 50});
```

and getn error:

> Uncaught NoElementException
> at new NoElementException (http://avi3.vm/sources/js/adds/plugins/barcode/JsBarcode.all.js?20240711153903:3595:125)
> at API.render (http://avi3.vm/sources/js/adds/plugins/barcode/JsBarcode.all.js?20240711153903:289:9)
> at JsBarcode (http://avi3.vm/sources/js/adds/plugins/barcode/JsBarcode.all.js?20240711153903:167:55)
> at GetBarCodeSample (:233:12)
> at NivAdd (:187:12)
> at HTMLButtonElement. (:51:20)
> at HTMLDocument.dispatch (http://avi3.vm/sources/js/adds/jquery.min.js?20240711153903:5429:27)
> at elemData.handle (http://avi3.vm/sources/js/adds/jquery.min.js?20240711153903:5233:28)

I'm thinking that it can't find it because the modal is hidden... or because the modal was added programmatically and it can't find it in the DOM.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported window.JsBarcode("#bc-" + string, string, ...) call with the provided hidden modal markup, then inspect whether the target element exists when API.render runs. Confirm whether rendering succeeds when the modal is present or shown, and document the supported behavior for dynamically added or hidden elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.