This commit is contained in:
Benoit Schweblin 2019-06-22 22:53:56 +01:00
parent 1b2d48ff22
commit 78802448c3
2 changed files with 6 additions and 4 deletions

View File

@ -3,7 +3,7 @@
<div class="modal__content">
<p>Please provide a <b>URL</b> for your image.</p>
<form-entry label="URL" error="url">
<input slot="field" class="textfield" type="text" v-model.trim="url" @keydown.enter="resolve()">
<input slot="field" class="textfield" type="text" v-model.trim="url" @keydown.enter="resolve">
</form-entry>
<menu-entry @click.native="openGooglePhotos(token)" v-for="token in googlePhotosTokens" :key="token.sub">
<icon-provider slot="icon" provider-id="googlePhotos"></icon-provider>
@ -44,7 +44,8 @@ export default modalTemplate({
},
},
methods: {
resolve() {
resolve(evt) {
evt.preventDefault(); // Fixes https://github.com/benweet/stackedit/issues/1503
if (!this.url) {
this.setError('url');
} else {

View File

@ -3,7 +3,7 @@
<div class="modal__content">
<p>Please provide a <b>URL</b> for your link.</p>
<form-entry label="URL" error="url">
<input slot="field" class="textfield" type="text" v-model.trim="url" @keydown.enter="resolve()">
<input slot="field" class="textfield" type="text" v-model.trim="url" @keydown.enter="resolve">
</form-entry>
</div>
<div class="modal__button-bar">
@ -21,7 +21,8 @@ export default modalTemplate({
url: '',
}),
methods: {
resolve() {
resolve(evt) {
evt.preventDefault(); // Fixes https://github.com/benweet/stackedit/issues/1503
if (!this.url) {
this.setError('url');
} else {