Commit ccf33f48 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'kp-fix-status-emoji-picker-position' into 'master'

Fix user status emoji picker positioning

See merge request gitlab-org/gitlab!77394
parents 04422b9a a0363e39
...@@ -28,6 +28,16 @@ export default { ...@@ -28,6 +28,16 @@ export default {
required: false, required: false,
default: () => [], default: () => [],
}, },
right: {
type: Boolean,
required: false,
default: true,
},
boundary: {
type: String,
required: false,
default: '',
},
}, },
data() { data() {
return { return {
...@@ -62,7 +72,7 @@ export default { ...@@ -62,7 +72,7 @@ export default {
addToFrequentlyUsed(name); addToFrequentlyUsed(name);
}, },
getBoundaryElement() { getBoundaryElement() {
return document.querySelector('.content-wrapper') || 'scrollParent'; return this.boundary || document.querySelector('.content-wrapper') || 'scrollParent';
}, },
onSearchInput() { onSearchInput() {
this.$refs.virtualScoller.setScrollTop(0); this.$refs.virtualScoller.setScrollTop(0);
...@@ -87,7 +97,7 @@ export default { ...@@ -87,7 +97,7 @@ export default {
menu-class="dropdown-extended-height" menu-class="dropdown-extended-height"
category="secondary" category="secondary"
no-flip no-flip
right :right="right"
lazy lazy
@shown="$emit('shown')" @shown="$emit('shown')"
@hidden="$emit('hidden')" @hidden="$emit('hidden')"
......
...@@ -267,6 +267,8 @@ export default { ...@@ -267,6 +267,8 @@ export default {
v-if="glFeatures.improvedEmojiPicker" v-if="glFeatures.improvedEmojiPicker"
dropdown-class="gl-h-full" dropdown-class="gl-h-full"
toggle-class="btn emoji-menu-toggle-button gl-px-4! gl-rounded-top-right-none! gl-rounded-bottom-right-none!" toggle-class="btn emoji-menu-toggle-button gl-px-4! gl-rounded-top-right-none! gl-rounded-bottom-right-none!"
boundary="viewport"
:right="false"
@click="setEmoji" @click="setEmoji"
> >
<template #button-content> <template #button-content>
......
...@@ -110,14 +110,23 @@ describe('SetStatusModalWrapper', () => { ...@@ -110,14 +110,23 @@ describe('SetStatusModalWrapper', () => {
}); });
describe('improvedEmojiPicker is true', () => { describe('improvedEmojiPicker is true', () => {
const getEmojiPicker = () => wrapper.findComponent(EmojiPicker);
beforeEach(async () => { beforeEach(async () => {
await initEmojiMock(); await initEmojiMock();
wrapper = createComponent({}, true); wrapper = createComponent({}, true);
return initModal(); return initModal();
}); });
it('renders emoji picker dropdown with custom positioning', () => {
expect(getEmojiPicker().props()).toMatchObject({
right: false,
boundary: 'viewport',
});
});
it('sets emojiTag when clicking in emoji picker', async () => { it('sets emojiTag when clicking in emoji picker', async () => {
await wrapper.findComponent(EmojiPicker).vm.$emit('click', 'thumbsup'); await getEmojiPicker().vm.$emit('click', 'thumbsup');
expect(wrapper.vm.emojiTag).toContain('data-name="thumbsup"'); expect(wrapper.vm.emojiTag).toContain('data-name="thumbsup"');
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment