@paypal/checkout-components
Advanced tools
Comparing version 5.0.5 to 5.0.6
{ | ||
"name": "@paypal/checkout-components", | ||
"version": "5.0.5", | ||
"version": "5.0.6", | ||
"description": "PayPal Checkout components, for integrating checkout products.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
/* @flow */ | ||
/** @jsx node */ | ||
import { values, destroyElement } from 'belter/src'; | ||
import { values, destroyElement, toCSS } from 'belter/src'; | ||
import { node, dom } from 'jsx-pragmatic/src'; | ||
@@ -66,4 +66,16 @@ import { EVENT, type RenderOptionsType } from 'zoid/src'; | ||
const setupAutoResize = (el) => { | ||
event.on(EVENT.RESIZE, ({ width: newWidth, height: newHeight }) => { | ||
if (typeof newWidth === 'number') { | ||
el.style.width = toCSS(newWidth); | ||
} | ||
if (typeof newHeight === 'number') { | ||
el.style.height = toCSS(newHeight); | ||
} | ||
}); | ||
}; | ||
return ( | ||
<div id={ uid } class={ `${ tag } ${ tag }-context-${ context } ${ tag }-label-${ label } ${ tag }-layout-${ layout }` }> | ||
<div id={ uid } onRender={ setupAutoResize } class={ `${ tag } ${ tag }-context-${ context } ${ tag }-label-${ label } ${ tag }-layout-${ layout }` }> | ||
@@ -70,0 +82,0 @@ <style> |
Sorry, the diff of this file is too big to display
567070
3882