@@ -204,22 +204,27 @@ class PreviewFrame extends React.Component {
204
204
] ;
205
205
const accessiblelib = sketchDoc . createElement ( 'script' ) ;
206
206
accessiblelib . setAttribute ( 'src' , 'https://cdn.rawgit.com/MathuraMG/p5-accessibility/9cb5bd0b/dist/p5-accessibility.js' ) ;
207
+ const accessibleOutputs = sketchDoc . createElement ( 'section' ) ;
208
+ accessibleOutputs . setAttribute ( 'id' , 'accessible-outputs' ) ;
207
209
if ( this . props . textOutput ) {
208
- sketchDoc . getElementById ( 'accessibility-library' ) . appendChild ( accessiblelib ) ;
210
+ sketchDoc . body . appendChild ( accessibleOutputs ) ;
211
+ sketchDoc . body . appendChild ( accessiblelib ) ;
209
212
const textSection = sketchDoc . createElement ( 'section' ) ;
210
213
textSection . setAttribute ( 'id' , 'textOutput-content' ) ;
211
214
sketchDoc . getElementById ( 'accessible-outputs' ) . appendChild ( textSection ) ;
212
215
this . iframeElement . focus ( ) ;
213
216
}
214
217
if ( this . props . gridOutput ) {
215
- sketchDoc . getElementById ( 'accessibility-library' ) . appendChild ( accessiblelib ) ;
218
+ sketchDoc . body . appendChild ( accessibleOutputs ) ;
219
+ sketchDoc . body . appendChild ( accessiblelib ) ;
216
220
const gridSection = sketchDoc . createElement ( 'section' ) ;
217
221
gridSection . setAttribute ( 'id' , 'gridOutput-content' ) ;
218
222
sketchDoc . getElementById ( 'accessible-outputs' ) . appendChild ( gridSection ) ;
219
223
this . iframeElement . focus ( ) ;
220
224
}
221
225
if ( this . props . soundOutput ) {
222
- sketchDoc . getElementById ( 'accessibility-library' ) . appendChild ( accessiblelib ) ;
226
+ sketchDoc . body . appendChild ( accessibleOutputs ) ;
227
+ sketchDoc . body . appendChild ( accessiblelib ) ;
223
228
const soundSection = sketchDoc . createElement ( 'section' ) ;
224
229
soundSection . setAttribute ( 'id' , 'soundOutput-content' ) ;
225
230
sketchDoc . getElementById ( 'accessible-outputs' ) . appendChild ( soundSection ) ;
0 commit comments