objecthub-io / ObjectHub

ObjectHub is an open repository for software objects and a development platform.
2 stars 1 forks source link

Adaptive markup in preview does not work as expected #261

Open DenisNedvigok opened 7 years ago

DenisNedvigok commented 7 years ago

Default HTML wrapper in MicroApp in preview has very small height. F.e. if you make a div element with 50% width and height the width seems to be quite as expected (half the preview area) while the height seems not to be influenced at all. This can be reperformed only with adaptive values, strict pixel values work just as expected.

Please refer example below: HTML markup:

<div><h1>Hello world!!!</h1></div>

JavaScript:

app.init = function(cb) {
    adaptiveDivIssue('yellow');
    cb();
};
var adaptiveDivIssue = function(color) {
    var doc = document.querySelectorAll('div');
    for (var i = 0; i < doc.length; i++){
    doc[i].style.width = '50%';
        doc[i].style.height = '100%';
        doc[i].style.backgroundColor = color;
    }
};
objecthub-io commented 7 years ago

Thank you for reporting this.

We will have a look if this can be fixed (it's caused by the HTML of the Micro App being wrapped in other divs).