@@ -712,16 +712,38 @@ field[ns.ui('Classifier').uri] = function (
712712 if ( ! ok ) return callbackFunction ( ok , body )
713713 return callbackFunction ( ok , body )
714714 }
715- const box = makeSelectForNestedCategory (
715+ // Create container for label and select
716+ const outerBox = dom . createElement ( 'div' )
717+ outerBox . setAttribute ( 'class' , 'classifierBox' )
718+ // Render label
719+ const labelDiv = dom . createElement ( 'div' )
720+ labelDiv . setAttribute ( 'class' , 'formFieldName classifierBox-label' )
721+ // Use fieldLabel to render ui:label if present
722+ labelDiv . appendChild ( fieldLabel ( dom , category , form ) )
723+ outerBox . appendChild ( labelDiv )
724+ // Render select
725+ const selectBox = dom . createElement ( 'div' )
726+ selectBox . setAttribute ( 'class' , 'formFieldValue classifierBox-selectBox' )
727+ const selectElement = makeSelectForNestedCategory (
716728 dom ,
717729 kb ,
718730 subject ,
719731 category ,
720732 dataDoc ,
721733 checkOptions
722734 )
723- if ( container ) container . appendChild ( box )
724- return box
735+ // Set readonly if not editable
736+ if ( selectElement && selectElement . querySelector && selectElement . querySelector ( 'select' ) ) {
737+ const select = selectElement . querySelector ( 'select' ) ;
738+ if ( select && ! kb . updater . editable ( dataDoc . uri ) ) {
739+ select . readOnly = true ;
740+ select . style = style . textInputStyleUneditable ;
741+ }
742+ }
743+ selectBox . appendChild ( selectElement )
744+ outerBox . appendChild ( selectBox )
745+ if ( container ) container . appendChild ( outerBox )
746+ return outerBox
725747}
726748
727749/** Choice field
0 commit comments