File tree Expand file tree Collapse file tree 3 files changed +19
-10
lines changed Expand file tree Collapse file tree 3 files changed +19
-10
lines changed Original file line number Diff line number Diff line change 1+ Significance: patch
2+ Type: fix
3+
4+ Fix payment method logos overflow in shortcode checkout after adding JCB and UnionPay logos.
Original file line number Diff line number Diff line change @@ -181,19 +181,15 @@ jQuery( function ( $ ) {
181181 const paymentMethods = getCardBrands ( ) ;
182182
183183 function getMaxElements ( ) {
184- const paymentMethodElement = document . querySelector (
185- '.payment_method_woocommerce_payments'
186- ) ;
187- if ( ! paymentMethodElement ) {
188- return 4 ; // Default fallback
189- }
184+ // Use viewport width as primary indicator (similar to blocks checkout)
185+ const viewportWidth = window . innerWidth ;
190186
191- const elementWidth = paymentMethodElement . offsetWidth ;
192- if ( elementWidth <= 300 ) {
187+ // Specific tablet viewport range (768-781px) - needs room for Test Mode badge
188+ if ( viewportWidth >= 768 && viewportWidth <= 900 ) {
193189 return 1 ;
194- } else if ( elementWidth <= 330 ) {
195- return 2 ;
196190 }
191+ // Default - show 3 logos + counter badge = 4 visual elements total
192+ return 3 ;
197193 }
198194
199195 function shouldHavePopover ( ) {
Original file line number Diff line number Diff line change 4141 img :last-of-type {
4242 margin-right : 0 ;
4343 }
44+
45+ & -count {
46+ margin-left : 4px ;
47+
48+ // Tighter spacing on tablet viewports (768-900px) to conserve space for Test Mode badge
49+ @media ( min-width : 768px ) and ( max-width : 900px ) {
50+ margin-left : 0 ;
51+ }
52+ }
4453 }
4554 img {
4655 float : right ;
You can’t perform that action at this time.
0 commit comments