fix: avoid wrong pagebreak inside of qr invoice in chrome printing

master
Katja Lutz 2 years ago
parent 0364a5e608
commit 2537b33cf2

@ -133,8 +133,13 @@ const SwissInvoice: Component<
<div class="text-xs leading-normal font-bold">{props.children}</div>
);
// Important: pt-px was added because: break-inside-avoid with the top-border results in a wrong pagebreak in chrome,
// the top-border remained on the first page and only the rest of the invoice was on the second page.
// AND: this only happend if scroll position was at the bottom.
// FIXME: Chrome should fix the break-inside-avoid calculation, when chrome has fixed their issue the pt-px can be removed.
return (
<div class="break-inside-avoid">
<div class="break-inside-avoid pt-px">
<div class="swissinvoice hyphenate break-normal break-all -max-w-[1200px] aspect-[2/1] print:w-full flex-shrink-0 text-left print:text-black text-sm bg-white border-y border-black border-dashed grid grid-flow-col grid-cols-[29.5%_26.5%_auto] grid-rows-[auto_auto_1fr]">
<div class="col-span-1 row-span-1 p-10 pb-0 border-r border-black border-dashed">
<HeaderEz>Empfangsschein</HeaderEz>

Loading…
Cancel
Save