FIX: prevents events on toolbar when in form (#7567)

If a button is not of type button, pressing enter inside an `<input>` inside a `<form>` without the action attribute will trigger the first available `<button>` as most browsers default the type of an unspecified button to submit.

This commit also prevents d-editor-modal to be filled when it's hidden.
This commit is contained in:
Joffrey JAFFEUX 2019-05-17 11:14:09 +02:00 committed by GitHub
parent 105359e54a
commit b05d7042ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

View File

@ -13,7 +13,8 @@ export default Ember.Component.extend({
"disabled",
"translatedTitle:title",
"translatedLabel:aria-label",
"tabindex"
"tabindex",
"type"
],
btnIcon: Ember.computed.notEmpty("icon"),

View File

@ -1,7 +1,8 @@
{{#unless hidden}}
{{yield}}
{{yield}}
<div class='controls'>
{{d-button class="btn-primary" label="composer.modal_ok" action=(action "ok")}}
{{d-button class="btn-danger" label="composer.modal_cancel" action=(action "cancel")}}
</div>
<div class="controls">
{{d-button class="btn-primary" label="composer.modal_ok" action=(action "ok")}}
{{d-button class="btn-danger" label="composer.modal_cancel" action=(action "cancel")}}
</div>
{{/unless}}

View File

@ -24,6 +24,7 @@
{{else}}
{{d-button
action=b.action
type="button"
actionParam=b
translatedTitle=b.title
label=b.label