Skip to content

Commit

Permalink
Fix issues in creator vue3 (#7398)
Browse files Browse the repository at this point in the history
* Fix update onShowing is not called for modal popup

* Fix questionWrapper css class is not applied

* Fix comment error for rating question in creator

* Remove vue additional div
  • Loading branch information
dk981234 authored Nov 22, 2023
1 parent 73cb7fa commit f4bcf8a
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 57 deletions.
5 changes: 4 additions & 1 deletion packages/survey-vue3-ui/src/Element.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<div :style="getRootStyle(element)">
<div
:style="getRootStyle(element)"
:class="element.cssClasses.questionWrapper"
>
<component
:is="componentName"
v-bind="componentData"
Expand Down
5 changes: 1 addition & 4 deletions packages/survey-vue3-ui/src/Question.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@
<div>
<survey-string :locString="element.locCommentText" />
</div>
<survey-question-comment
:commentClass="css.comment"
:question="element"
/>
<survey-question-comment :question="element" />
</div>
<survey-errors
v-if="hasErrorsOnBottom"
Expand Down
3 changes: 1 addition & 2 deletions packages/survey-vue3-ui/src/QuestionComment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
:id="question.commentId"
:readonly="question.isInputReadOnly"
:disabled="question.isInputReadOnly"
:class="question.cssClasses.other || commentClass"
:class="question.cssClasses.other"
:value="question.comment"
:maxlength="question.getOthersMaxLength()"
:placeholder="question.renderedCommentPlaceholder"
Expand All @@ -31,6 +31,5 @@
import type { Question } from "survey-core";
defineProps<{
question: Question;
commentClass?: any;
}>();
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
</template>
<script lang="ts" setup>
import { useBase } from "@/base";
import type { PopupBaseViewModel } from "survey-core";
import { onUpdated } from "vue";
import { Model, type PopupBaseViewModel } from "survey-core";
import { onMounted, onUpdated } from "vue";
const props = defineProps<{ model: PopupBaseViewModel }>();
let prevIsVisible = false;
Expand All @@ -72,4 +72,9 @@ onUpdated(() => {
}
prevIsVisible = model.isVisible;
});
onMounted(() => {
if (props.model.isVisible) {
props.model.updateOnShowing();
}
});
</script>
91 changes: 43 additions & 48 deletions packages/survey-vue3-ui/src/components/title/TitleContent.vue
Original file line number Diff line number Diff line change
@@ -1,56 +1,51 @@
<template>
<div class="sv-vue-title-additional-div">
<survey-string
v-if="element.isTitleRenderedAsString"
:locString="element.locTitle"
/>
<span
v-if="!element.isTitleRenderedAsString && element.isRequireTextOnStart"
:class="element.cssClasses.requiredText"
:aria-hidden="true"
>{{ element.requiredText }}</span
>
<span
v-if="!element.isTitleRenderedAsString && element.no"
style="position: static"
:class="element.cssTitleNumber"
:aria-hidden="true"
>{{ element.no }}</span
>
<span v-if="!element.isTitleRenderedAsString && element.no">&nbsp;</span>
<span
v-if="
!element.isTitleRenderedAsString && element.isRequireTextBeforeTitle
"
:class="element.cssClasses.requiredText"
:aria-hidden="true"
>{{ element.requiredText }}</span
>
<span
v-if="
!element.isTitleRenderedAsString && element.isRequireTextBeforeTitle
"
>&nbsp;</span
>
<survey-string
v-if="!element.isTitleRenderedAsString"
:locString="element.locTitle"
/>
<span
v-if="!element.isTitleRenderedAsString && element.isRequireTextAfterTitle"
>&nbsp;</span
>
<span
v-if="!element.isTitleRenderedAsString && element.isRequireTextAfterTitle"
:class="element.cssClasses.requiredText"
:aria-hidden="true"
>{{ element.requiredText }}</span
>
</div>
<survey-string
v-if="element.isTitleRenderedAsString"
:locString="element.locTitle"
/>
<span
v-if="!element.isTitleRenderedAsString && element.isRequireTextOnStart"
:class="element.cssClasses.requiredText"
:aria-hidden="true"
>{{ element.requiredText }}</span
>
<span
v-if="!element.isTitleRenderedAsString && element.no"
style="position: static"
:class="element.cssTitleNumber"
:aria-hidden="true"
>{{ element.no }}</span
>
<span v-if="!element.isTitleRenderedAsString && element.no">&nbsp;</span>
<span
v-if="!element.isTitleRenderedAsString && element.isRequireTextBeforeTitle"
:class="element.cssClasses.requiredText"
:aria-hidden="true"
>{{ element.requiredText }}</span
>
<span
v-if="!element.isTitleRenderedAsString && element.isRequireTextBeforeTitle"
>&nbsp;</span
>
<survey-string
v-if="!element.isTitleRenderedAsString"
:locString="element.locTitle"
/>
<span
v-if="!element.isTitleRenderedAsString && element.isRequireTextAfterTitle"
>&nbsp;</span
>
<span
v-if="!element.isTitleRenderedAsString && element.isRequireTextAfterTitle"
:class="element.cssClasses.requiredText"
:aria-hidden="true"
>{{ element.requiredText }}</span
>
</template>

<script lang="ts" setup>
import type { PanelModel, Question } from "survey-core";
defineOptions({ inheritAttrs: false });
defineProps<{
element: Question | PanelModel;
css: any;
Expand Down

0 comments on commit f4bcf8a

Please sign in to comment.