Skip to content

Commit

Permalink
Work for #8254 - Console Warnings when running the Form Library demo …
Browse files Browse the repository at this point in the history
…- Warning: Cannot update during an existing state transition (such as within render) - refactoring - get rid of unnecessary code
  • Loading branch information
tsv2013 committed May 15, 2024
1 parent 745c4fb commit ba4a43f
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ export class DropdownComponent extends BaseAngular implements OnInit {

override ngOnInit(): void {
super.ngOnInit();
if (!this.model.dropdownListModel) {
this.model.dropdownListModel = new DropdownListModel(this.model);
}
}

click(event: any) {
Expand Down
4 changes: 0 additions & 4 deletions packages/survey-vue3-ui/src/components/dropdown/Dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ import { computed, onMounted, onUpdated, ref } from "vue";
const props = defineProps<{ question: Question }>();
const inputElement = ref<HTMLElement>(null as any);
const model = computed(() => {
const question = props.question;
if (!question.dropdownListModel) {
question.dropdownListModel = new DropdownListModel(question);
}
return props.question.dropdownListModel;
});
const click = (event: any) => {
Expand Down
3 changes: 0 additions & 3 deletions src/knockout/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ ko.components.register("sv-dropdown", {
const focus = (_: any, e: any) => {
q.dropdownListModel?.onFocus(e);
};
if (!q.dropdownListModel) {
q.dropdownListModel = new DropdownListModel(params.question);
}
new ImplementorBase(q.dropdownListModel);
return { question: q, model: q.dropdownListModel, click: click, clear: clear, keyhandler: keyhandler, blur: blur, focus: focus, chevronPointerDown: chevronPointerDown };
},
Expand Down
3 changes: 0 additions & 3 deletions src/react/dropdown-base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ export class SurveyQuestionDropdownBase<T extends Question> extends SurveyQuesti
{this.renderReadOnlyElement()}
</div>;
} else {
if (!(this.question as any)["dropdownListModel"]) {
(this.question as any)["dropdownListModel"] = new DropdownListModel(this.question);
}
selectElement = <>
{this.renderInput(this.question["dropdownListModel"])}
<Popup model={this.question?.dropdownListModel?.popupModel}></Popup>
Expand Down
3 changes: 0 additions & 3 deletions src/vue/components/dropdown/dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ export class DropdownComponent extends BaseVue {
return this.question.dropdownListModel;
}
getModel() {
if (!this.question.dropdownListModel) {
this.question.dropdownListModel = new DropdownListModel(this.question);
}
return this.model;
}
Expand Down

0 comments on commit ba4a43f

Please sign in to comment.