Skip to content

Commit

Permalink
[EuiCodeEditor] Console error when using the editor without import th…
Browse files Browse the repository at this point in the history
…e default theme (#3454)

* [EuiCodeEditor] Console error when using the editor without importing the default theme

* set textmate as a default schema
  • Loading branch information
alexwizp authored May 12, 2020
1 parent f66a390 commit 4ad4f2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Added `utcOffset` prop to `EuiSuperDatePicker` ([#3436](https://github.com/elastic/eui/pull/3436))
- Added `partition` key to `EuiChartThemeType` for Partition chart support ([#3387](https://github.com/elastic/eui/pull/3387))
- Updated `EuiImage`'s `caption` prop type from `string` to `ReactNode` ([#3387](https://github.com/elastic/eui/pull/3387))
- Fixed `EuiCodeEditor` console error when using the editor without import the default theme ([#3454](https://github.com/elastic/eui/pull/3454))

**Bug Fixes**

Expand Down
3 changes: 2 additions & 1 deletion src/components/code_editor/code_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { htmlIdGenerator, keyCodes } from '../../services';
import { EuiI18n } from '../i18n';

const DEFAULT_MODE = 'text';
const DEFAULT_THEME = 'textmate';

function setOrRemoveAttribute(
element: HTMLTextAreaElement,
Expand Down Expand Up @@ -215,7 +216,7 @@ export class EuiCodeEditor extends Component<
cursorStart,
mode = DEFAULT_MODE,
'data-test-subj': dataTestSubj = 'codeEditorContainer',
theme = 'github',
theme = DEFAULT_THEME,
...rest
} = this.props;

Expand Down

0 comments on commit 4ad4f2e

Please sign in to comment.