FIX: prevents trash button to get focus when submiting input on profile (#8198)

This is a default behavior for browsers to submit using first button which doesn't have `type="button"` in a form when pressing enter inside an input.
This commit is contained in:
Joffrey JAFFEUX 2019-10-16 10:05:46 +02:00 committed by GitHub
parent c596d7df77
commit 5a543f8abd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 8 deletions

View File

@ -9,15 +9,21 @@
</label> </label>
{{#if imageUrl}} {{#if imageUrl}}
<button {{action "trash"}} class="btn btn-danger pad-left no-text">{{d-icon "far-trash-alt"}}</button> {{d-button
{{/if}} action=(action "trash")
class="btn-danger pad-left no-text"
icon="far-trash-alt"
type="button"
}}
{{#if imageUrl}} {{d-button
{{d-button icon="discourse-expand" icon="discourse-expand"
title='expand' title="expand"
class="btn image-uploader-lightbox-btn no-text" type="button"
class="image-uploader-lightbox-btn no-text"
action=(action "toggleLightbox") action=(action "toggleLightbox")
disabled=loadingLightbox}} disabled=loadingLightbox
}}
{{/if}} {{/if}}
<span class="btn {{unless uploading 'hidden'}}">{{i18n 'upload_selector.uploading'}} {{uploadProgress}}%</span> <span class="btn {{unless uploading 'hidden'}}">{{i18n 'upload_selector.uploading'}} {{uploadProgress}}%</span>