question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Vaadin 19] Web Component generated by WebComponentExporter is not lined up

See original GitHub issue

Description of the bug / feature

Web component generated by WebComponentExporter has by default:

:host {
    position: relative;
    display: inline-block;  <<<<<
}

Because of this when I put my web component in a simple servlet (according to the documentation) component is not lined up: image Blue web component is inside a red div container. Its because web component with inline-block has alignment = baseline. I have to set manually vertical-align: top to get it lined up.

Expected behavior

I think web component generated by WebComponentExporter should be by default lined up.

Versions:

- Vaadin / Flow version: 19.0.0.beta4
- Java version: 8

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
darmrocommented, Mar 1, 2021

Hi Yes. I have static html page with a simple div as a container (100% of height and width) and web component (generated by WebComponentExporter ) inside this container. I was surprised when I saw that this web component is not lined up and there is empty space above it. After quick investigation it turns out that it’s because web component is set by framework as inline-block (and has default alignment = baseline). I have to manualy set alignment in my static html to line component up. I think it should be done by default by framework 😃

0reactions
darmrocommented, Mar 12, 2021

I forgot to write that servlet url is /myapp/example

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Vaadin 19] Web Component generated by ...
In this scenario there is a big problem in situation when WebComponentExporter component openes a vaadin Dialog: web component is embeded in ...
Read more >
Web components do not appear to load correctly (Vaadin 14)
Hi, I'm developing an web application with Spring Boot 2 / Vaadin 14 and have noticed that on restarting the application, the web...
Read more >
How to use Angular Components with Vaadin
A detailed tutorial on how to build a Web Component from Angular Components and how to use the result in a Vaadin application....
Read more >
Why embedded vaadin 14 components don't show up on ...
I'm tried to embed one of my Vaadin view in the facelets page as mentioned in the doc on Vaadin website as below....
Read more >
"Fossies" - the Fresh Open Source Software Archive
15 */ 16 17 package com.vaadin.flow.server.frontend; 18 19 import java.io. ... WebComponentModulesWriter} to 36 * generate web component modules files from ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found