FIX: prevents msg-actions to show hover text (#19952)
This case was possible in restrained space when the top of the message was not visible in the viewport.
This commit is contained in:
parent
34d158c4aa
commit
ffd222e883
|
@ -4,8 +4,7 @@ import { createPopper } from "@popperjs/core";
|
|||
import { schedule } from "@ember/runloop";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
const MSG_ACTIONS_HORIZONTAL_PADDING = 2;
|
||||
const MSG_ACTIONS_VERTICAL_PADDING = -28;
|
||||
const MSG_ACTIONS_VERTICAL_PADDING = -10;
|
||||
|
||||
export default Component.extend({
|
||||
tagName: "",
|
||||
|
@ -28,27 +27,13 @@ export default Component.extend({
|
|||
`.chat-message-actions-container[data-id="${this.message.id}"] .chat-message-actions`
|
||||
),
|
||||
{
|
||||
placement: "right-start",
|
||||
placement: "top-end",
|
||||
modifiers: [
|
||||
{ name: "hide", enabled: true },
|
||||
{
|
||||
name: "eventListeners",
|
||||
options: {
|
||||
scroll: false,
|
||||
},
|
||||
},
|
||||
{ name: "eventListeners", options: { scroll: false } },
|
||||
{
|
||||
name: "offset",
|
||||
options: {
|
||||
offset: ({ popper, placement }) => {
|
||||
return [
|
||||
MSG_ACTIONS_VERTICAL_PADDING,
|
||||
-(placement.includes("left") || placement.includes("right")
|
||||
? popper.width + MSG_ACTIONS_HORIZONTAL_PADDING
|
||||
: popper.height),
|
||||
];
|
||||
},
|
||||
},
|
||||
options: { offset: [0, MSG_ACTIONS_VERTICAL_PADDING] },
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue