web-components icon indicating copy to clipboard operation
web-components copied to clipboard

Bug: Input-Fields wrongly rendered with Chrome OS

Open lucaschraml opened this issue 2 years ago • 13 comments

Description of the bug

When i fill Input-Fields like Comboboxes or Datepickers with values, the values will render on other components aswell. For testing i used the vaadin starter and added the "Adress Form"-View. The problem only occurs on Chrome OS (Version i used: 103.0.5060.114). Screenshot 2022-07-12 15 04 25 Screenshot 2022-07-12 15 12 27 Screenshot 2022-07-12 15 15 24

Expected behavior

The Fields should not display the values of other Fields

Minimal reproducible example

To reproduce the bug you have to use a Chromebook with Chrome OS (Version: 103.0.5060.114). Create a vaadin starter (https://start.vaadin.com/app) and fill in some values into the Input-Fields.

Versions

  • Vaadin / Flow version: 23
  • Java version: 11
  • OS version: Chrome OS Version 103.0.5060.114
  • Browser version (if applicable): Version 103.0.5060.114
  • Application Server (if applicable):
  • IDE (if applicable):

lucaschraml avatar Jul 12 '22 13:07 lucaschraml

Confirmed on Linux (Fedora 36 with Wayland) with Chrome Version 103.0.5060.114 (Official Build) (64-bit)

Screenshot from 2022-07-12 15-38-44

cromoteca avatar Jul 12 '22 13:07 cromoteca

Not reproduceable on Windows 10 Pro (10.0.19044 Build 19044) with Google Chrome Version 103.0.5060.114 (Official Build) (64-Bit) grafik

F0rce avatar Jul 12 '22 14:07 F0rce

Moved the issue to web components repo as it looks like a Chrome rendering bug.

web-padawan avatar Jul 12 '22 18:07 web-padawan

I tried to reproduce this in a virtual machine on Mac M1 (Ubuntu 20.04, Chromium 103.0.5060.53) and there it works:

Screenshot 2022-07-13 at 12 11 47

web-padawan avatar Jul 13 '22 09:07 web-padawan

Could also reproduce this issue on my ChromeBook (Chrome version 103.0.5060.64) Chrome/Firefox on Mac works fine

sirbris avatar Jul 13 '22 09:07 sirbris

Can confirm not reproduceable on Mac (Monterey Version 12.4 - 21F79) with Google Chrome Version 103.0.5060.114 (Official Build) (x86_64)

F0rce avatar Jul 13 '22 09:07 F0rce

As mentioned internally, when commenting the “-webkit-mask-image” CSS property the issue seems to disappear. Here is the suspicious line, could you please try if removing it helps or not?

https://github.com/vaadin/web-components/blob/e8b431e1e0f6a4428876de1d348f1b5a544936ed/packages/input-container/theme/lumo/vaadin-input-container-styles.js#L42

The file is located here: node_modules/@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js.

web-padawan avatar Jul 13 '22 11:07 web-padawan

Can confirm, when removing the "-webkit-mask-image" CSS property the issue disappears.

lucaschraml avatar Jul 13 '22 11:07 lucaschraml

Thanks. It should be possible to override this using custom theme by adding the following CSS:

::slotted(:not([slot$='fix'])) {
  --_lumo-text-field-overflow-mask-image: none !important;
}

This code needs to be placed in the frontend/themes/{my-theme}/components/input-container.css file.

web-padawan avatar Jul 13 '22 12:07 web-padawan

Since we just migrated from V14 to V23, there's no theme set yet... can that CSS part be just imported in the main view as well or how should it be done without theme?

sirbris avatar Jul 13 '22 14:07 sirbris

To answer my own question: Use this annotation on MainView and add the given css to that file like @web-padawan mentioned: @CssImport(value = "./styles/components/input-container.css", themeFor = "vaadin-input-container")

sirbris avatar Jul 18 '22 11:07 sirbris

Sorry about not answering your question. Yes, @CssImport is the right way to apply styles without using custom theme.

web-padawan avatar Jul 18 '22 11:07 web-padawan

When using readonly input-fields, its kind of the opposite. When --_lumo-text-field-overflow-mask-image: none !important; is applied the issue occurs like the screenshot is showing. image

So suggest the following: ::slotted(:not([slot$='fix']):not([readonly])) { --_lumo-text-field-overflow-mask-image: none !important; } Thats how it looks like when the fix is applied: image

lucaschraml avatar Jul 20 '22 07:07 lucaschraml

Could also reproduce this issue on my openSUSE Tumbleweed (Chrome Version 110.0.5481.177 (Official Build) (64-bit))

KingFalse avatar Mar 08 '23 14:03 KingFalse

This would seem to be caused by a GPU acceleration bug in Chromium: https://bugs.chromium.org/p/chromium/issues/detail?id=1399431

rolfsmeds avatar Mar 08 '23 15:03 rolfsmeds

How could we workaround in Vaadin 24.1? I tried

vaadin-input-container::slotted(:not([slot$='fix'])) {
    --_lumo-text-field-overflow-mask-image: none !important;
}

But that does not seem to help.

This also does happen with regular Chrome on Linux at my side.

eiswind avatar Aug 01 '23 13:08 eiswind

The mask is applied on the native <input> element, the selector for which is simply input, or, if you want to be component-specific, vaadin-text-field > input (as seen in the css selector reference for Text Field).

Since you probably want to apply it to all fields, you can just use input, so this should do it:

input {
  --_lumo-text-field-overflow-mask-image: none;
}

rolfsmeds avatar Aug 02 '23 16:08 rolfsmeds

I can no longer reproduce this on Chrome 114 on Chrome OS (same version), so presumably the issue has been fixed in Chrome despite the ticket still being open.

Closing as fixed. Please comment if you can reproduce this is the latest version of Chrome, and I'll reopen.

rolfsmeds avatar Aug 08 '23 06:08 rolfsmeds