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
3 changed files with 10 additions and 7 deletions

View File

@@ -13,7 +13,8 @@ export default Ember.Component.extend({
"disabled", "disabled",
"translatedTitle:title", "translatedTitle:title",
"translatedLabel:aria-label", "translatedLabel:aria-label",
"tabindex" "tabindex",
"type"
], ],
btnIcon: Ember.computed.notEmpty("icon"), 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")}}
<div class='controls'> {{d-button class="btn-danger" label="composer.modal_cancel" action=(action "cancel")}}
{{d-button class="btn-primary" label="composer.modal_ok" action=(action "ok")}} </div>
{{d-button class="btn-danger" label="composer.modal_cancel" action=(action "cancel")}} {{/unless}}
</div>

View File

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