@@ -712,16 +712,40 @@ 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 . querySelectorAll ) {
737+ const selects = selectElement . querySelectorAll ( 'select' )
738+ if ( selects . length && ! kb . updater . editable ( dataDoc . uri ) ) {
739+ selects . forEach ( select => {
740+ select . readOnly = true
741+ select . style = style . textInputStyleUneditable
742+ } )
743+ }
744+ }
745+ selectBox . appendChild ( selectElement )
746+ outerBox . appendChild ( selectBox )
747+ if ( container ) container . appendChild ( outerBox )
748+ return outerBox
725749}
726750
727751/** Choice field
0 commit comments