submit with shift + enter

implement_matrix
adb 4 years ago
parent d7d1340245
commit af35a2e501

@ -1,10 +1,12 @@
<template> <template>
<div class="newMessageBanner"> <div class="newMessageBanner">
<label for="newMessageInput"></label> <form v-on:submit.prevent="sendMessage()">
<textarea @input="resizeMessageBanner()" ref="newMessageInput" id="newMessageInput" class="newMessageInput" <label for="newMessageInput"></label>
autocomplete="off" placeholder="type a message ..." v-model="msg.content.text" /> <textarea v-on:keyup.shift.enter="sendMessage()" v-on:input="resizeMessageBanner()" ref="newMessageInput" id="newMessageInput" class="newMessageInput"
<icon @click.native="sendMessage()" id="sendMessageBtn" style="position: absolute; right: 1rem; bottom: 0.5rem;" autocomplete="off" placeholder="type a message ..." v-model="msg.content.text" />
ic="./sym/ic_send_white_24px.svg" /> <icon @click.native="sendMessage()" title="press shift + enter to submit" id="sendMessageBtn"
ic="./sym/ic_send_white_24px.svg" />
</form>
</div> </div>
</template> </template>
@ -55,32 +57,47 @@ export default {
</script> </script>
<style scoped> <style scoped>
.newMessageBanner{ .newMessageBanner{
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: min-content; height: min-content;
min-height: 4rem; min-height: 4rem;
background-color: #1d1d1d; background-color: #1d1d1d;
border-radius: 1rem 1rem 0 0; border-radius: 1rem 1rem 0 0;
} }
.newMessageInput{ .newMessageInput{
position: relative; position: relative;
margin-top: 1.5rem; margin-top: 1.5rem;
margin-bottom: 1rem; margin-bottom: 1rem;
left: 2rem; left: 2rem;
min-height: 1.25rem; min-height: 1.25rem;
max-height: 10rem; max-height: 10rem;
width: calc(100% - 7rem); width: calc(100% - 7rem);
height: 1.25rem; height: 1.25rem;
background-color: #fff0; background-color: #fff0;
border: 0 solid #fff0; border: 0 solid #fff0;
color: #fff; color: #fff;
font-size: 1rem; font-size: 1rem;
resize: none; resize: none;
vertical-align: middle; vertical-align: middle;
font-family: Avenir, Helvetica, Arial, sans-serif; font-family: Avenir, Helvetica, Arial, sans-serif;
} }
#sendMessageBtn{
position: absolute;
right: 1rem;
bottom: 0.5rem;
}
#sendMessageBtn:hover::after{
content: "press shift + enter to submit";
position: absolute;
padding: 1rem;
bottom: 4rem;
right: 0;
width: 14rem;
background-color: #eee;
color: #000;
border-radius: 1rem;
}
</style> </style>
Loading…
Cancel
Save