mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
Fix focussed select does not close when it loses focus
Mail reply moves focus from To: to body, and To dropdown stayed open
This commit is contained in:
parent
db8bd9dcc3
commit
3e1b1e56dc
@ -713,6 +713,15 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
||||
return tag;
|
||||
}
|
||||
|
||||
blur()
|
||||
{
|
||||
if(typeof super.blur == "function")
|
||||
{
|
||||
super.blur();
|
||||
}
|
||||
this.dropdown.hide();
|
||||
}
|
||||
|
||||
private handleTagRemove(event : CustomEvent, option)
|
||||
{
|
||||
event.stopPropagation();
|
||||
@ -758,6 +767,17 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
||||
}
|
||||
}
|
||||
|
||||
private et2HandleBlur(event : Event)
|
||||
{
|
||||
if(typeof super.et2HandleBlur === "function")
|
||||
{
|
||||
super.et2HandleBlur(event);
|
||||
}
|
||||
console.log("Blur event");
|
||||
|
||||
this.dropdown?.hide();
|
||||
}
|
||||
|
||||
/**
|
||||
* Always close the dropdown if an option is clicked, even if multiple=true. This differs from SlSelect,
|
||||
* which leaves the dropdown open for multiple=true
|
||||
|
@ -400,6 +400,11 @@ app.classes.mail = AppJS.extend(
|
||||
var content = this.et2.getArrayMgr('content').data;
|
||||
if (to && to.get_value() && to.get_value().length > 0)
|
||||
{
|
||||
if (typeof to.blur == "function")
|
||||
{
|
||||
// html area changes focus as part of its init, make sure it doesn't re-focus to
|
||||
to.blur();
|
||||
}
|
||||
if (content.is_plain)
|
||||
{
|
||||
// focus
|
||||
@ -407,9 +412,11 @@ app.classes.mail = AppJS.extend(
|
||||
// get the cursor to the top of the textarea
|
||||
if (typeof plainText.getDOMNode().setSelectionRange !='undefined' && !jQuery(plainText.getDOMNode()).is(":hidden"))
|
||||
{
|
||||
setTimeout(function(){
|
||||
plainText.getDOMNode().setSelectionRange(0,0)
|
||||
setTimeout(function ()
|
||||
{
|
||||
plainText.getDOMNode().setSelectionRange(0, 0)
|
||||
plainText.focus();
|
||||
plainText.shadowRoot.querySelector("textarea").scrollTop = 0;
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user