mnahkies/ng-qrcode

Is there any way to make the QR Code size responsive without workarounds?

fbueckle opened this issue · 1 comments

Resizing the qr-code element using view port height/width is not working. The DOM element is reduced but the actually displayed code will remain the same size no matter what happens.

I would probably be able to resize the qr-code every time that the size of the window changes by binding the size to a value in my typescript file but that doesn't sound like a good workaround.

Am i just missing something or is there currently no simple solution to achieve responsiveness?

I've not given much thought to this so far, but would be interested in improving it.

In the meantime you should be able to use https://material.angular.io/cdk/layout/api#BreakpointObserver to change the size based on the current breakpoint, but I agree this doesn't feel very ergonomic. It's probably a better solution than subscribing directly to window resizing events though.

If you wanted to come up with a solution yourself I'm happy to review and accept PR's