From eb664afa8f13639bf7bfa923169f911f7290ee64 Mon Sep 17 00:00:00 2001 From: Valentin Silytuin Date: Sat, 29 Mar 2025 00:13:28 +0400 Subject: [PATCH] Fix virtialReference --> virtualReference --- README.md | 6 +++--- index.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c16c872..6713068 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ createTooltip(document.querySelector('button'), 'Подсказка', { shiftPadding: [8, 0], theme: 'light', trigger: 'mouseenter', - virtialReference: undefined, + virtualReference: undefined, zIndex: '', // Callback-функции, по-умолчанию не заданы onCreate(instance) {}, @@ -56,7 +56,7 @@ createTooltip(document.querySelector('button'), 'Подсказка', { }); ``` -##### virtialReference +##### virtualReference Настройка используется для кастомного позиционирования, ожидает объект с методом `getBoundingClientRect`. @@ -64,7 +64,7 @@ createTooltip(document.querySelector('button'), 'Подсказка', { ```js createTooltip(document.querySelector('button'), 'Подсказка', { - virtialReference: { + virtualReference: { getBoundingClientRect() { return { x: 0, diff --git a/index.js b/index.js index ca8f3f1..9405a20 100644 --- a/index.js +++ b/index.js @@ -26,7 +26,7 @@ export const createTooltip = ($el, content, options) => { shiftPadding: [8, 0], theme: 'light', trigger: 'mouseenter', - virtialReference: undefined, + virtualReference: undefined, zIndex: '', ...options, }; @@ -167,7 +167,7 @@ export const createTooltip = ($el, content, options) => { const $arrow = $el._tooltip.$tooltip.querySelector('.tooltip__arrow'); const { x, y, placement, middlewareData } = await computePosition( - options.virtialReference ?? $el, + options.virtualReference ?? $el, $el._tooltip.$tooltip, { placement: options.placement,