Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions src/wwElement_Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 || []
Expand All @@ -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()));
Expand All @@ -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) {
Expand Down
11 changes: 0 additions & 11 deletions ww-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down