For some reason the generated svg has a fixed(?) size and does not take into account the parent container. It also ignores any attributes added to the <svg> tag such as width="100%". Because of that, a separate function has to be called that adds the 100% width after the generation. Although not high impact, it's just bad spaghetti code.
function setBarcodeWidth() {
$('#barcode').attr('width', '100%');
}
For some reason the generated svg has a fixed(?) size and does not take into account the parent container. It also ignores any attributes added to the
<svg>
tag such aswidth="100%"
. Because of that, a separate function has to be called that adds the 100% width after the generation. Although not high impact, it's just bad spaghetti code.It seems that this can be reproduced and it might be an issue with the lib itself:" https://codepen.io/dauntedpine10/pen/zYMzOQP
Repro steps:
container-fluid
that takes up the viewport