@@ -570,7 +570,6 @@ export class QuestionAdornerViewModel extends SurveyElementAdornerBase {
570
570
const action = this . creator . createIActionBarItemByClass ( item , needSeparator , ( questionType , json ) => { this . convertQuestion ( questionType , json , defaultJsons ) ; } ) ;
571
571
if ( this . toolboxItemIsCorresponded ( item , ! ! selectedAction ) ) {
572
572
selectedAction = action ;
573
- selectedSubactions = item . items ;
574
573
}
575
574
if ( item . items ?. length > 0 && this . creator . toolbox . showSubitems ) {
576
575
const subactions = [ ] ;
@@ -596,8 +595,8 @@ export class QuestionAdornerViewModel extends SurveyElementAdornerBase {
596
595
if ( selectedSubactionLocal ) {
597
596
selectedAction = action ;
598
597
selectedSubaction = selectedSubactionLocal ;
599
- selectedSubactions = subactions ;
600
598
}
599
+ selectedSubactions = subactions ;
601
600
}
602
601
lastItem = item ;
603
602
newItems . push ( action ) ;
@@ -626,12 +625,12 @@ export class QuestionAdornerViewModel extends SurveyElementAdornerBase {
626
625
cssClasses : listComponentCss ,
627
626
} ) ;
628
627
this . updateQuestionTypeOrSubtypeListModel ( listModel , true ) ;
629
- if ( listModel . actions . length == 0 ) return null ;
630
-
628
+ const propName = QuestionToolbox . getSubTypePropertyName ( this . surveyElement . getType ( ) ) ;
629
+ if ( ! listModel . selectedItem && ! propName ) return null ;
631
630
const actionData : IAction = {
632
631
id : "convertInputType" ,
633
632
visibleIndex : 1 ,
634
- title : listModel . selectedItem ?. title || "SUBTYPE" ,
633
+ title : listModel . selectedItem ?. title || editorLocalization . getPropertyValueInEditor ( propName , this . surveyElement . getPropertyValue ( propName ) ) || "SUBTYPE" ,
635
634
disableShrink : true ,
636
635
iconName : "icon-chevron_16x16"
637
636
} ;
@@ -642,14 +641,13 @@ export class QuestionAdornerViewModel extends SurveyElementAdornerBase {
642
641
this . updateQuestionTypeOrSubtypeListModel ( listModel , true ) ;
643
642
}
644
643
} ) ;
645
-
646
644
this . surveyElement . registerFunctionOnPropertiesValueChanged (
647
- [ "inputType" , "rateType" ] ,
648
- ( ) => {
645
+ [ propName ] ,
646
+ ( newValue ) => {
649
647
const popup = newAction . popupModel ;
650
648
const list = popup . contentComponentData . model ;
651
649
this . updateQuestionTypeOrSubtypeListModel ( list , true ) ;
652
- newAction . title = list . selectedItem . title ;
650
+ newAction . title = list . selectedItem ? .title || editorLocalization . getPropertyValueInEditor ( propName , newValue ) || "SUBTYPE" ;
653
651
} ,
654
652
"inputTypeAdorner"
655
653
) ;
0 commit comments