Skip to content

Commit

Permalink
[controls] fix Time Slider text is not working properly with Dark Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Nov 17, 2022
1 parent 58cb0e4 commit e955d5b
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import moment from 'moment-timezone';
import { Embeddable, IContainer } from '@kbn/embeddable-plugin/public';
import { ReduxEmbeddableTools, ReduxEmbeddablePackage } from '@kbn/presentation-util-plugin/public';
import type { TimeRange } from '@kbn/es-query';
import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public';
import React from 'react';
import ReactDOM from 'react-dom';
import { Subscription } from 'rxjs';
Expand Down Expand Up @@ -270,16 +271,18 @@ export class TimeSliderControlEmbeddable extends Embeddable<
const { Wrapper: TimeSliderControlReduxWrapper } = this.reduxEmbeddableTools;

ReactDOM.render(
<TimeSliderControlReduxWrapper>
<TimeSlider
formatDate={this.epochToKbnDateFormat}
onChange={(value?: [number, number]) => {
this.onTimesliceChange(value);
const range = value ? value[TO_INDEX] - value[FROM_INDEX] : undefined;
this.onRangeChange(range);
}}
/>
</TimeSliderControlReduxWrapper>,
<KibanaThemeProvider theme$={pluginServices.getServices().theme.theme$}>
<TimeSliderControlReduxWrapper>
<TimeSlider
formatDate={this.epochToKbnDateFormat}
onChange={(value?: [number, number]) => {
this.onTimesliceChange(value);
const range = value ? value[TO_INDEX] - value[FROM_INDEX] : undefined;
this.onRangeChange(range);
}}
/>
</TimeSliderControlReduxWrapper>
</KibanaThemeProvider>,
node
);
};
Expand Down

0 comments on commit e955d5b

Please sign in to comment.