alexandruantochi / cardnado

1 stars 0 forks source link

Barcode overflows the div parent, needs manual adjustment after generation #1

Open alexandruantochi opened 1 year ago

alexandruantochi commented 1 year ago

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%');
}

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:

alexandruantochi commented 1 year ago

image