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(input): [input] fix textarea x-design style #2076

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -44,7 +44,7 @@ const hoverText = ref('')

<style scoped>
.demo-input .tiny-textarea {
width: 400px;
width: fit-content;
margin: 5px;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/input/resize.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test('可缩放文本域', async ({ page }) => {
.boundingBox()
.then((box) => box?.height)

await expect(fill1Height).not.toEqual(defaultHeight)
await expect(fill1Height).toEqual(defaultHeight)
await expect(fill1Height).toEqual(fill2Height)

// autosize 检查高度
Expand All @@ -41,7 +41,7 @@ test('可缩放文本域', async ({ page }) => {
.then((box) => box?.height)
await textarea2.nth(1).fill(fillText + fillText)
fill1Height = await textarea2
.nth(0)
.nth(1)
.boundingBox()
.then((box) => box?.height)
await expect(fill1Height).not.toBeNull()
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/input/resize.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default {
<style lang="less" scoped>
.demo-input {
.tiny-textarea {
width: 400px;
width: fit-content;
margin: 5px;
}
.expand {
Expand Down
35 changes: 34 additions & 1 deletion packages/theme/src/textarea/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,30 @@
vertical-align: bottom;
font-size: var(--ti-textarea-font-size);

&:before {
content: '';
width: calc(100% - 16px);
height: 8px;
position: absolute;
left: 2px;
top: 2px;
z-index: 1;
background: #fff;
border-radius: var(--ti-textarea-border-radius);
}

&:after {
content: '';
width: calc(100% - 18px);
height: 16px;
position: absolute;
left: 2px;
bottom: 2px;
z-index: 1;
background: #fff;
border-radius: var(--ti-textarea-border-radius);
}

&.is-disabled &__inner {
background-color: var(--ti-textarea-disabled-bg-color);
border-color: var(--ti-textarea-border-color);
Expand Down Expand Up @@ -64,12 +88,13 @@
font-size: var(--ti-textarea-count-font-size);
text-align: right;
position: absolute;
z-index: 2;
line-height: 1.5;
bottom: var(--ti-textarea-count-bottom);
right: var(--ti-textarea-count-right);
width: var(--ti-textarea-count-width);
border-bottom-left-radius: var(--ti-textarea-count-border-radius);
padding-right: var(--ti-textarea-count-padding-right);
line-height: var(--ti-textarea-count-line-height);

&-text-length {
color: var(--ti-textarea-count-text-length-color);
Expand Down Expand Up @@ -167,6 +192,14 @@
line-height: 1.5;
}

&:before {
display: none;
}

&:after {
display: none;
}

.@{textarea-prefix-cls}__inner-con {
height: auto;

Expand Down
Loading