mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 17:53:43 +08:00
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
a0f61f4a25
commit
482739c171
|
@ -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
Block a user