mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-11-04 04:57:51 +00:00 
			
		
		
		
	Fixes https://github.com/chatwoot/chatwoot/issues/8436 Fixes https://github.com/chatwoot/chatwoot/issues/9767 Fixes https://github.com/chatwoot/chatwoot/issues/10156 Fixes https://github.com/chatwoot/chatwoot/issues/6031 Fixes https://github.com/chatwoot/chatwoot/issues/5696 Fixes https://github.com/chatwoot/chatwoot/issues/9250 Fixes https://github.com/chatwoot/chatwoot/issues/9762 --------- Co-authored-by: Pranav <pranavrajs@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
		
			
				
	
	
		
			39 lines
		
	
	
		
			713 B
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			713 B
		
	
	
	
		
			Vue
		
	
	
	
	
	
<script setup>
 | 
						|
import { ref, computed, onMounted, nextTick, defineEmits } from 'vue';
 | 
						|
 | 
						|
const { x, y } = defineProps({
 | 
						|
  x: { type: Number, default: 0 },
 | 
						|
  y: { type: Number, default: 0 },
 | 
						|
});
 | 
						|
const emit = defineEmits(['close']);
 | 
						|
 | 
						|
const left = ref(x);
 | 
						|
const top = ref(y);
 | 
						|
 | 
						|
const style = computed(() => ({
 | 
						|
  top: top.value + 'px',
 | 
						|
  left: left.value + 'px',
 | 
						|
}));
 | 
						|
 | 
						|
const target = ref();
 | 
						|
onMounted(() => {
 | 
						|
  nextTick(() => {
 | 
						|
    target.value.focus();
 | 
						|
  });
 | 
						|
});
 | 
						|
</script>
 | 
						|
 | 
						|
<template>
 | 
						|
  <Teleport to="body">
 | 
						|
    <div
 | 
						|
      ref="target"
 | 
						|
      class="fixed outline-none z-[9999] cursor-pointer"
 | 
						|
      :style="style"
 | 
						|
      tabindex="0"
 | 
						|
      @blur="emit('close')"
 | 
						|
    >
 | 
						|
      <slot />
 | 
						|
    </div>
 | 
						|
  </Teleport>
 | 
						|
</template>
 |