mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 05:14:12 +03:00
Fixed "Send invitation" button needing to be clicked twice
refs https://github.com/TryGhost/Ghost/issues/7131 - adds `disableMouseDown` flag to `{{gh-task-button}}` - uses flag for the send invite button so that the focus-out validation on the e-mail input is not triggered before the click event is triggered
This commit is contained in:
parent
708c95d2b8
commit
63b8127cfa
@ -135,6 +135,14 @@ const GhTaskButton = Component.extend({
|
||||
return false;
|
||||
},
|
||||
|
||||
// mouseDown can be prevented, this is useful for situations where we want
|
||||
// to avoid on-blur events triggering before the button click
|
||||
mouseDown(event) {
|
||||
if (this.disableMouseDown) {
|
||||
event.preventDefault();
|
||||
}
|
||||
},
|
||||
|
||||
// when local validation fails there's no transition from failed->running
|
||||
// so we want to restart the retry spinner animation to show something
|
||||
// has happened when the button is clicked
|
||||
|
@ -54,5 +54,6 @@
|
||||
successText="Sent"
|
||||
task=sendInvitation
|
||||
class="gh-btn gh-btn-green gh-btn-icon"
|
||||
disabled=fetchRoles.isRunning}}
|
||||
disabled=fetchRoles.isRunning
|
||||
disableMouseDown=true}}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user