Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[text-field] Broken vaadin-text-area scroll in Material theme #1333

Closed
3 tasks done
Edoazzi opened this issue Jan 30, 2019 · 4 comments · Fixed by #3359
Closed
3 tasks done

[text-field] Broken vaadin-text-area scroll in Material theme #1333

Edoazzi opened this issue Jan 30, 2019 · 4 comments · Fixed by #3359
Assignees
Labels
BFP Bug fix prioritised by a customer bug Something isn't working needs research More information needed to estimate refactor Internal improvement requires new major This would be a breaking change vaadin-text-field workaround There is a workaround in the comments.
Projects

Comments

@Edoazzi
Copy link

Edoazzi commented Jan 30, 2019

Description

When using Material Theme and vaadin-tex-area has a defined height, writing text and when the scroll is show, the Material bar in the Bottom is scrolled together with the Text.

text_area_scroll

Browsers Affected

  • Chrome
  • Firefox
  • Android Chrome
@niiyeboah niiyeboah self-assigned this Feb 15, 2019
@web-padawan
Copy link
Member

Problem is in pseudo elements applied to [part="input-field"].

We can try to move them to :host and using a single pseudo element.
If that doesn't help with a solution, then it will require a breaking change.

@yuriy-fix yuriy-fix self-assigned this Jul 1, 2019
@yuriy-fix
Copy link
Contributor

Moving pseudo elements to the :host won't work properly as in that case they won't respect the width of the scroller and the height of error-message which is stylable part.
So this one requires breaking change.

@yuriy-fix yuriy-fix removed their assignment Jan 9, 2020
@vaadin-bot vaadin-bot transferred this issue from vaadin/vaadin-text-field May 19, 2021
@vaadin-bot vaadin-bot added bug Something isn't working needs research More information needed to estimate refactor Internal improvement requires new major This would be a breaking change vaadin-text-field labels May 19, 2021
@web-padawan web-padawan changed the title vaadin-text-area and scroll in Material theme [text-field] Broken vaadin-text-area scroll in Material theme May 28, 2021
@TatuLund TatuLund added the workaround There is a workaround in the comments. label Dec 30, 2021
@jouni
Copy link
Member

jouni commented Dec 30, 2021

I would say the best workaround is to use the internal .vaadin-text-area-container selector and move the pseudo elements there (note that there’s also the ::after element which is used for the focused state).

Something like this (I didn't try this in the browser):

[part="input-field"]::before,
[part="input-field"]::after {
  display: none;
}

.vaadin-text-area-container::before,
.vaadin-text-area-container::after {
  order: 3;
  content: "";
  display: block;
  height: 1px;
  background-color: var(--_material-text-field-input-line-background-color, #000);
  opacity: var(--_material-text-field-input-line-opacity, 0.42);
}

.vaadin-text-area-container::after {
  margin-top: -1px;
  background-color: var(--material-primary-color);
  opacity: 0;
  height: 2px;
  transform: scaleX(0);
  transition: opacity 0.175s;
}

:host([focused]) .vaadin-text-area-container::after,
:host([invalid]) .vaadin-text-area-container::after {
  opacity: 1;
  transform: none;
  transition: transform 0.175s, opacity 0.175s;
}

[part="label"] {
  order: 1;
}

[part="input-field"] {
  order: 2;
}

[part="error-message"] {
  order: 4;
}

@jouni
Copy link
Member

jouni commented Jan 31, 2022

Another alternative might be to expose the height of the text area as a custom property on the host, and then a theme could use that to calculate the position of anything it needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFP Bug fix prioritised by a customer bug Something isn't working needs research More information needed to estimate refactor Internal improvement requires new major This would be a breaking change vaadin-text-field workaround There is a workaround in the comments.
Projects
No open projects
vaadin-core
  
Issue Backlog
8 participants