From 76907ea09fd5f3a9b64522daac078f13d965d460 Mon Sep 17 00:00:00 2001 From: Alexy Carlier Date: Thu, 13 Feb 2025 09:03:32 +0100 Subject: [PATCH 1/2] delete select type tooltip --- ww-config.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ww-config.js b/ww-config.js index 6e811a9..fe35ba7 100644 --- a/ww-config.js +++ b/ww-config.js @@ -380,17 +380,6 @@ export default { }, /* wwEditor:end */ }, - /* wwEditor:start */ - selectTypeWarning: { - type: 'InfoBox', - section: 'settings', - options: { - title: 'Select type', - content: - 'The select configuration and layout are strongly tied to the select type. Changing the type requires understanding how to adjust the layout (specifically the options displayed in the trigger) to match the new type.', - }, - }, - /* wwEditor:end */ disabled: { label: { en: 'Disabled' }, type: 'OnOff', From bb00606fb84305124ef1b89d0816809bf3bbc8cf Mon Sep 17 00:00:00 2001 From: Alexy Carlier Date: Mon, 17 Mar 2025 09:33:04 +0100 Subject: [PATCH 2/2] Revert to useFloating library, but in dialog, keep simple manual positionning --- src/wwElement_Select.vue | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/wwElement_Select.vue b/src/wwElement_Select.vue index a699aa8..ac8c903 100644 --- a/src/wwElement_Select.vue +++ b/src/wwElement_Select.vue @@ -114,6 +114,8 @@ export default { return false; }); + const isInDialog = inject('isInDialog', false); + const selectType = computed(() => props.content.selectType); const initValue = computed(() => selectType.value === 'single' ? props.content.initValueSingle || null : props.content.initValueMulti || [] @@ -140,7 +142,7 @@ export default { const triggerElement = ref(null); const dropdownElement = ref(null); - //const { floatingStyles, syncFloating } = useDropdownFloating(triggerElement, dropdownElement); + let { floatingStyles, syncFloating } = useDropdownFloating(triggerElement, dropdownElement); const autoFocus = computed(() => props.content.autoFocus); const optionsMap = ref(new Map()); const options = computed(() => Array.from(optionsMap.value.values())); @@ -164,17 +166,19 @@ export default { const showSearch = computed(() => props.content.showSearch); // Styles - const syncFloating = () => {} - const floatingStyles = computed(() => { - if (triggerElement.value) { - return { - position: 'absolute', - top: `${triggerElement.value.offsetHeight + parseInt(props.content.offsetY)}px`, - left: `${triggerElement.value.offsetLeft + parseInt(props.content.offsetX)}px`, - }; - } - return {}; - }); + if (isInDialog) { + syncFloating = () => {} + floatingStyles = computed(() => { + if (triggerElement.value) { + return { + position: 'absolute', + top: `${triggerElement.value.offsetHeight + parseInt(props.content.offsetY)}px`, + left: `${triggerElement.value.offsetLeft + parseInt(props.content.offsetX)}px`, + }; + } + return {}; + }); + } const selectStyles = computed(() => { if (isOpen.value && props.content.zIndexOpen) {