Skip to content

Commit db4f750

Browse files
committed
(fix) css issues
1 parent a84039e commit db4f750

File tree

5 files changed

+27
-18
lines changed

5 files changed

+27
-18
lines changed

demo/src/App.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ body {
124124
125125
.app-container {
126126
font-family: 'Quicksand', sans-serif;
127-
line-height: 1.5;
128127
padding: 10px 20px 20px;
129128
130129
@media only screen and (max-width: 768px) {

src/ChatWindow/Message.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,11 @@ export default {
383383
this.$emit('hideOptions', false)
384384
385385
setTimeout(() => {
386-
if (!this.roomFooterRef || !this.$refs.menuOptions || !this.$refs.actionIcon)
386+
if (
387+
!this.roomFooterRef ||
388+
!this.$refs.menuOptions ||
389+
!this.$refs.actionIcon
390+
)
387391
return
388392
389393
const menuOptionsHeight = this.$refs.menuOptions.getBoundingClientRect()
@@ -480,6 +484,7 @@ export default {
480484
padding: 3px 10px;
481485
align-items: end;
482486
min-width: 100px;
487+
box-sizing: content-box;
483488
}
484489
485490
.offset-current {
@@ -494,11 +499,9 @@ export default {
494499
font-size: 14px;
495500
padding: 6px 9px 3px;
496501
white-space: pre-wrap;
497-
display: block;
498502
max-width: 100%;
499503
-webkit-transition-property: box-shadow, opacity;
500504
transition-property: box-shadow, opacity;
501-
overflow-wrap: break-word;
502505
transition: box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
503506
will-change: box-shadow;
504507
box-shadow: 0 1px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14),

src/ChatWindow/Room.vue

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,10 @@
156156
'textarea-image': imageFile
157157
}"
158158
:style="{
159-
height: `${imageDimensions.height}px`,
160-
'min-height': `${imageDimensions.height - 14}px`,
159+
height: `${imageDimensions.height - 12}px`,
160+
'min-height': `${
161+
imageDimensions.height > 20 ? imageDimensions.height - 14 : 20
162+
}px`,
161163
'padding-left': `${imageDimensions.width + 6}px`
162164
}"
163165
v-model="message"
@@ -260,7 +262,7 @@ export default {
260262
loadingMoreMessages: false,
261263
file: null,
262264
imageFile: null,
263-
imageDimensions: { height: '32px', width: '10px' },
265+
imageDimensions: { height: '20px', width: '10px' },
264266
menuOpened: false,
265267
emojiOpened: false,
266268
emojisList: {},
@@ -336,7 +338,7 @@ export default {
336338
imageFile() {
337339
setTimeout(() => {
338340
if (!this.$refs.imageFile)
339-
return (this.imageDimensions = { height: 32, width: 10 })
341+
return (this.imageDimensions = { height: 20, width: 10 })
340342
341343
this.imageDimensions = {
342344
height: this.$refs.imageFile.height + 2,
@@ -417,7 +419,7 @@ export default {
417419
},
418420
resetTextareaSize() {
419421
if (!this.$refs['roomTextarea']) return
420-
this.$refs['roomTextarea'].style.height = '32px'
422+
this.$refs['roomTextarea'].style.height = '20px'
421423
},
422424
focusTextarea() {
423425
if (this.isMobile) return
@@ -501,7 +503,7 @@ export default {
501503
resizeTextarea(textarea) {
502504
textarea.style.height = 0
503505
const offset = this.imageFile ? 2 : 0
504-
textarea.style.height = textarea.scrollHeight + offset + 'px'
506+
textarea.style.height = textarea.scrollHeight - 24 + offset + 'px'
505507
},
506508
addEmoji(emoji) {
507509
this.message += emoji.icon
@@ -695,18 +697,19 @@ export default {
695697
}
696698
697699
textarea {
698-
background: var(--chat-bg-color-input);
699-
color: var(--chat-color);
700-
border-radius: 20px;
701-
padding: 12px 140px 0 16px;
700+
height: 20px;
701+
width: 100%;
702702
overflow: hidden;
703703
outline: 0;
704-
width: 100%;
705704
resize: none;
706-
height: 32px;
705+
border-radius: 20px;
706+
padding: 12px 140px 12px 16px;
707+
box-sizing: content-box;
708+
font-size: 16px;
709+
background: var(--chat-bg-color-input);
710+
color: var(--chat-color);
707711
caret-color: var(--chat-color-caret);
708712
border: var(--chat-border-style-input);
709-
font-size: 16px;
710713
711714
&::placeholder {
712715
color: var(--chat-color-placeholder);
@@ -769,7 +772,9 @@ textarea {
769772
display: flex;
770773
align-items: center;
771774
width: 100%;
772-
height: 44px;
775+
height: 20px;
776+
padding: 12px 0;
777+
box-sizing: content-box;
773778
background: var(--chat-bg-color-input);
774779
border: var(--chat-border-style-input);
775780
border-radius: 20px;

src/ChatWindow/RoomsList.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ input {
240240
.title-container {
241241
display: flex;
242242
align-items: center;
243+
line-height: 25px;
243244
}
244245
245246
.text-ellipsis {

src/styles/menu.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
padding: 7px 16px;
3030
position: relative;
3131
white-space: nowrap;
32+
line-height: 30px;
3233
}
3334

3435
.menu-options {

0 commit comments

Comments
 (0)