GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.36k stars 4.05k forks source link

Question : Get real width selected element after resize it #2709

Closed arretnet closed 4 years ago

arretnet commented 4 years ago

Hi, I use Grapesjs to create template to generate pdf in Wordpress.All is ok( wonderful appli) except I need to get the width of the selected element when its size change and I block on this, but sounds really simple. Best regards Patrice Coacolo Annotation 2020-04-12 191254

arretnet commented 4 years ago

BTW, forgot to say, the real one I need is number one, about n° 2 it's ok, sorry.

Best regards Patrice Coacolo

arretnet commented 4 years ago

Hi found how to do: editor.on('component:deselected',(model) => {

const computed = getComputedStyle(model.view.el);

var width_=computed.width;

});