Skip to content

Extra wrapper <div> makes height: 100% not work #65

@jaens

Description

@jaens

Are you certain it's a bug?

  • Yes, it looks like a bug

Are you sure this is not an issue in noVNC?

  • It is not a noVNC issue

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Issue description

The VncScreen component adds an extra unstyleable wrapper <div> around the main noVNC <div>, which means setting <VncScreen style={{ height: '100%' }} ...> does nothing, since the height of the wrapper <div> will default to 0 (ie. the component will just turn invisible) due to the CSS box model.

(height: 100% is particularly useful in conjunction with scaleViewport and flexbox to eg. render an almost fullscreen VNC but with a variable-sized header/toolbar before it)

Right now, there's no good way to make this work nicely (without CSS children selector > div hacks and even more wrapper divs anyway)

Location of issue:

return (
<div>
<div
style={style}
className={className}
ref={screen}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
/>
{loading && (loadingUI ?? <div className="text-white loading">Loading...</div>)}
</div>

I propose that the <div> should be a fragment instead to make it work nicely with all CSS layouts (ie. return <> <div>...</div> { ... } </>)

(this issue was introduced in d716043)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleased

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions