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

fix(core): PrimitiveTextfield drop wrong text-overflow: ellipsis (horizontal scroll bug) #2733

Merged
merged 1 commit into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@
:host-context(tui-text-area._focused:not(._readonly))::placeholder {
opacity: 1;
}

&::placeholder,
&:placeholder-shown {
.text-overflow();
}
}

textarea:host {
Expand Down
1 change: 0 additions & 1 deletion projects/core/styles/mixins/textfield.less
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
overflow: hidden;
text-transform: inherit;
resize: none;
text-overflow: ellipsis;

:host[data-mode='onDark'] &,
:host-context(tui-primitive-textfield[data-mode='onDark']),
Expand Down
22 changes: 20 additions & 2 deletions projects/demo-integrations/cypress/tests/kit/input/input.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ describe(`Input`, () => {
.matchImageSnapshot(`04-custom-normal-icon-content-cleaner-hint`);
});

// TODO: fix after adding native input to example
it(`input overflow due to placeholder`, () => {
cy.viewport(400, 812);
cy.tuiVisit(
`${INPUT_PAGE_URL}/API?tuiMode=null&icon=tuiIconSearch&iconAlign=left&pseudoFocused=true`,
`${INPUT_PAGE_URL}/API?tuiMode=null&icon=tuiIconSearch&iconAlign=left&pseudoFocused=true&attr.placeholder=Lorem%20ipsum%20dolor%20sit%20amet,%20consectetur%20adipiscing%20elit,%20sed%20do%20eiusmod%20tempor%20incididunt%20ut%20labore`,
);

cy.get(`.t-input-wrapper`)
Expand Down Expand Up @@ -94,4 +93,23 @@ describe(`Input`, () => {
.blur()
.matchImageSnapshot(`07-very-long-text-without-text-ellipsis`);
});

it(`can be horizontally scrolled`, () => {
cy.viewport(450, 300).tuiVisit(`components/input/API`);

cy.get(`#demoContent`).should(`be.visible`).as(`wrapper`);
cy.get(`@wrapper`).find(`tui-input input[tuiTextfield]`).as(`input`);

cy.get(`@input`)
.should(`not.have.css`, `text-overflow`, `ellipsis`)
.focus()
.clear()
.type(
`You should not set 'text-overflow: ellipsis' for input because it can be horizontally scrolled`,
)
.blur();

cy.get(`@input`).scrollTo(`center`, {ensureScrollable: false});
cy.get(`@wrapper`).matchImageSnapshot(`08-horizontally-scrolled`);
});
});