diff --git a/packages/survey-creator-core/src/components/simulator.ts b/packages/survey-creator-core/src/components/simulator.ts index d41885adba..b926753321 100644 --- a/packages/survey-creator-core/src/components/simulator.ts +++ b/packages/survey-creator-core/src/components/simulator.ts @@ -1,4 +1,5 @@ import { Base, CssClassBuilder, property, SurveyModel } from "survey-core"; +import { SurveyCreatorModel } from "../creator-base"; require("./simulator.scss"); @@ -6,12 +7,13 @@ export class SurveySimulatorModel extends Base { private surveyChanged() { const _this = this; this.survey.onOpenDropdownMenu.add((_, options) => { + if (this.surveyProvider.isTouch) return; const device = simulatorDevices[_this.activeDevice]; options.menuType = device.deviceType === "desktop" ? "dropdown" : (device.deviceType == "tablet" ? "popup" : "overlay"); }); } - constructor() { + constructor(private surveyProvider: SurveyCreatorModel) { super(); // if (!!_toolbarHolder) { // this.simulatorOptions.survey = this._toolbarHolder.koSurvey; diff --git a/packages/survey-creator-core/src/components/tabs/preview.ts b/packages/survey-creator-core/src/components/tabs/preview.ts index 8304c40410..649639839c 100644 --- a/packages/survey-creator-core/src/components/tabs/preview.ts +++ b/packages/survey-creator-core/src/components/tabs/preview.ts @@ -72,7 +72,7 @@ export class PreviewViewModel extends Base { constructor(protected surveyProvider: SurveyCreatorModel, private startThemeClasses: any = defaultV2Css) { super(); - this.simulator = new SurveySimulatorModel(); + this.simulator = new SurveySimulatorModel(surveyProvider); } public get isMobileView() { diff --git a/packages/survey-creator-core/src/components/tabs/test-plugin.ts b/packages/survey-creator-core/src/components/tabs/test-plugin.ts index d4f1ef9188..cf9f5153f5 100644 --- a/packages/survey-creator-core/src/components/tabs/test-plugin.ts +++ b/packages/survey-creator-core/src/components/tabs/test-plugin.ts @@ -151,7 +151,7 @@ export class TabTestPlugin implements ICreatorPlugin { iconName: "icon-device-desktop", mode: "small", visible: new ComputedUpdater(() => { - return notShortCircuitAnd(this.creator.activeTab === "test", this.creator.showSimulatorInTestSurveyTab); + return notShortCircuitAnd(this.creator.activeTab === "test", this.creator.showSimulatorInTestSurveyTab, !this.creator.isTouch); }), }, { items: deviceSelectorItems, @@ -169,7 +169,7 @@ export class TabTestPlugin implements ICreatorPlugin { iconName: "icon-device-rotate", mode: "small", visible: new ComputedUpdater(() => { - return notShortCircuitAnd(this.creator.activeTab === "test", this.creator.showSimulatorInTestSurveyTab); + return notShortCircuitAnd(this.creator.activeTab === "test", this.creator.showSimulatorInTestSurveyTab, !this.creator.isTouch); }), action: () => { this.model.simulator.landscape = !this.model.simulator.landscape;