@@ -405,6 +405,11 @@ window.L.TextInput = window.L.Layer.extend({
405405 _initLayout : function ( ) {
406406 this . _container = window . L . DomUtil . create ( 'div' , 'clipboard-container' ) ;
407407 this . _container . id = 'doc-clipboard-container' ;
408+
409+ this . _textAreaLabel = window . L . DomUtil . create ( 'label' , 'visuallyhidden' , this . _container ) ;
410+ this . _textAreaLabel . id = 'clipboard-area-label' ;
411+ this . _textAreaLabel . innerHTML = 'clipboard area' ;
412+
408413 // The textarea allows the keyboard to pop up and so on.
409414 // Note that the contents of the textarea are NOT deleted on each composed
410415 // word, in order to make
@@ -416,10 +421,8 @@ window.L.TextInput = window.L.Layer.extend({
416421 this . _textArea . setAttribute ( 'autocorrect' , 'off' ) ;
417422 this . _textArea . setAttribute ( 'autocomplete' , 'off' ) ;
418423 this . _textArea . setAttribute ( 'spellcheck' , 'false' ) ;
424+ this . _textArea . setAttribute ( 'aria-labelledby' , this . _textAreaLabel . id ) ;
419425
420- this . _textAreaLabel = window . L . DomUtil . create ( 'label' , 'visuallyhidden' , this . _container ) ;
421- this . _textAreaLabel . setAttribute ( 'for' , 'clipboard-area' ) ;
422- this . _textAreaLabel . innerHTML = 'clipboard area' ;
423426 if ( this . hasAccessibilitySupport ( ) ) {
424427 this . _setSelectionFlag ( false ) ;
425428 }
0 commit comments