@@ -47,8 +47,9 @@ import {
47
47
import { FormattedMessage } from '@osd/i18n/react' ;
48
48
import { isEmpty } from 'lodash' ;
49
49
import { i18n } from '@osd/i18n' ;
50
+ import { DocLinksStart , ToastsStart } from 'opensearch-dashboards/public' ;
51
+ import { createPortal } from 'react-dom' ;
50
52
import { toMountPoint } from '../../../../../opensearch_dashboards_react/public' ;
51
- import { DocLinksStart , ToastsStart } from '../../../../../../core/public' ;
52
53
53
54
import { getCategoryName } from '../../lib' ;
54
55
import { Field , getEditableValue } from '../field' ;
@@ -338,7 +339,7 @@ export class Form extends PureComponent<FormProps> {
338
339
renderBottomBar = ( ) => {
339
340
const areChangesInvalid = this . areChangesInvalid ( ) ;
340
341
return (
341
- < EuiBottomBar data-test-subj = "advancedSetting-bottomBar" >
342
+ < EuiBottomBar data-test-subj = "advancedSetting-bottomBar" position = "sticky" >
342
343
< EuiFlexGroup
343
344
justifyContent = "spaceBetween"
344
345
alignItems = "center"
@@ -400,12 +401,7 @@ export class Form extends PureComponent<FormProps> {
400
401
const { visibleSettings, categories, categoryCounts, clearQuery } = this . props ;
401
402
const currentCategories : Category [ ] = [ ] ;
402
403
const hasUnsavedChanges = ! isEmpty ( unsavedChanges ) ;
403
-
404
- if ( hasUnsavedChanges ) {
405
- document . body . classList . add ( 'osdBody--mgtAdvancedSettingsHasBottomBar' ) ;
406
- } else {
407
- document . body . classList . remove ( 'osdBody--mgtAdvancedSettingsHasBottomBar' ) ;
408
- }
404
+ const container = document . getElementById ( 'app-wrapper-panel' ) ! ;
409
405
410
406
categories . forEach ( ( category ) => {
411
407
if ( visibleSettings [ category ] && visibleSettings [ category ] . length ) {
@@ -426,7 +422,7 @@ export class Form extends PureComponent<FormProps> {
426
422
} )
427
423
: this . maybeRenderNoSettings ( clearQuery ) }
428
424
</ div >
429
- { hasUnsavedChanges && this . renderBottomBar ( ) }
425
+ { hasUnsavedChanges && createPortal ( this . renderBottomBar ( ) , container ) }
430
426
</ Fragment >
431
427
) ;
432
428
}
0 commit comments