@@ -565,7 +565,6 @@ export class QuestionAdornerViewModel extends SurveyElementAdornerBase {
565
565
const action = this . creator . createIActionBarItemByClass ( item , needSeparator , ( questionType , json ) => { this . convertQuestion ( questionType , json , defaultJsons ) ; } ) ;
566
566
if ( this . toolboxItemIsCorresponded ( item , ! ! selectedAction ) ) {
567
567
selectedAction = action ;
568
- selectedSubactions = item . items ;
569
568
}
570
569
if ( item . items ?. length > 0 && this . creator . toolbox . showSubitems ) {
571
570
const subactions = [ ] ;
@@ -591,8 +590,8 @@ export class QuestionAdornerViewModel extends SurveyElementAdornerBase {
591
590
if ( selectedSubactionLocal ) {
592
591
selectedAction = action ;
593
592
selectedSubaction = selectedSubactionLocal ;
594
- selectedSubactions = subactions ;
595
593
}
594
+ selectedSubactions = subactions ;
596
595
}
597
596
lastItem = item ;
598
597
newItems . push ( action ) ;
@@ -621,12 +620,12 @@ export class QuestionAdornerViewModel extends SurveyElementAdornerBase {
621
620
cssClasses : listComponentCss ,
622
621
} ) ;
623
622
this . updateQuestionTypeOrSubtypeListModel ( listModel , true ) ;
624
- if ( listModel . actions . length == 0 ) return null ;
625
-
623
+ const propName = QuestionToolbox . getSubTypePropertyName ( this . surveyElement . getType ( ) ) ;
624
+ if ( ! listModel . selectedItem && ! propName ) return null ;
626
625
const actionData : IAction = {
627
626
id : "convertInputType" ,
628
627
visibleIndex : 1 ,
629
- title : listModel . selectedItem ?. title || "SUBTYPE" ,
628
+ title : listModel . selectedItem ?. title || editorLocalization . getPropertyValueInEditor ( propName , this . surveyElement . getPropertyValue ( propName ) ) || "SUBTYPE" ,
630
629
disableShrink : true ,
631
630
iconName : "icon-chevron_16x16"
632
631
} ;
@@ -637,14 +636,13 @@ export class QuestionAdornerViewModel extends SurveyElementAdornerBase {
637
636
this . updateQuestionTypeOrSubtypeListModel ( listModel , true ) ;
638
637
}
639
638
} ) ;
640
-
641
639
this . surveyElement . registerFunctionOnPropertiesValueChanged (
642
- [ "inputType" , "rateType" ] ,
643
- ( ) => {
640
+ [ propName ] ,
641
+ ( newValue ) => {
644
642
const popup = newAction . popupModel ;
645
643
const list = popup . contentComponentData . model ;
646
644
this . updateQuestionTypeOrSubtypeListModel ( list , true ) ;
647
- newAction . title = list . selectedItem . title ;
645
+ newAction . title = list . selectedItem ? .title || editorLocalization . getPropertyValueInEditor ( propName , newValue ) || "SUBTYPE" ;
648
646
} ,
649
647
"inputTypeAdorner"
650
648
) ;
0 commit comments