mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -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"),
|
||||||
|
|||||||
@@ -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>
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user