# Login dialog closes upon mouse button up

**URL:** https://meta.discourse.org/t/login-dialog-closes-upon-mouse-button-up/114731
**Category:** Bug
**Created:** [April 11, 2019, 7:57am UTC](https://meta.discourse.org/t/login-dialog-closes-upon-mouse-button-up/114731 "2019-04-11T07:57:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jack2](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@jack2](https://meta.discourse.org/u/jack2)
#### Post date: [April 11, 2019, 7:57am UTC](https://meta.discourse.org/t/login-dialog-closes-upon-mouse-button-up/114731/1 "2019-04-11T07:57:34Z")

</div>

There is an annoying behavior with the login modal dialog: it closes whenever you release the mouse button outside of the dialog. I think this issue is rather new.

This is what happens to me all the time:

1. I click Login
2. I select the previous user name with the mouse so that I can enter another one (I do this a lot for testing purpose). To do this, I click at the end of the user name, drag the selection to the left and release the mouse button outside of the dialog.

Expecting behavior: the user name ends up selected.  
Actual behavior: the dialog closes.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 11, 2019, 8:06am UTC](https://meta.discourse.org/t/login-dialog-closes-upon-mouse-button-up/114731/2 "2019-04-11T08:06:16Z")

</div>

I’ve seen this with the search box too and it is suuuper annoying cc @sam.

---

<div class="post-metadata">

### Author: ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)
#### Post date: [April 11, 2019, 6:23pm UTC](https://meta.discourse.org/t/login-dialog-closes-upon-mouse-button-up/114731/5 "2019-04-11T18:23:17Z")

</div>

I have [fixed](https://github.com/discourse/discourse/pull/7366) this by using `mousedown` instead of `click`, but I am not 100% sure about this solution.

I cannot remember, is this a new bug or a regression?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 11, 2019, 10:53pm UTC](https://meta.discourse.org/t/login-dialog-closes-upon-mouse-button-up/114731/6 "2019-04-11T22:53:41Z")

</div>

This is definitely new, I would have noticed the search drop-down closing on mouse-up before now. It was super irritating.

It’s still happening for me on meta though. Mouseup outside the search dialog is closing it

---

<div class="post-metadata">

### Author: ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)
#### Post date: [April 24, 2019, 4:43pm UTC](https://meta.discourse.org/t/login-dialog-closes-upon-mouse-button-up/114731/7 "2019-04-24T16:43:29Z")

</div>


