Skip to content

Commit dcd557b

Browse files
committed
fix: call renderMath in categories PD-5135
1 parent 4b9859c commit dcd557b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

  • packages/categorize/configure/src/design/categories

packages/categorize/configure/src/design/categories/index.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import ReactDOM from 'react-dom';
23
import PropTypes from 'prop-types';
34
import { withStyles } from '@material-ui/core/styles';
45
import { choiceUtils as utils } from '@pie-lib/pie-toolbox/config-ui';
@@ -16,6 +17,7 @@ import Category from './category';
1617
import Header from '../header';
1718
import { generateValidationMessage, getMaxCategoryChoices } from '../../utils';
1819
import { RowLabel } from './RowLabel';
20+
import { renderMath } from '@pie-lib/pie-toolbox/math-rendering';
1921

2022
const styles = (theme) => ({
2123
categories: {
@@ -79,6 +81,20 @@ export class Categories extends React.Component {
7981
focusedEl: null,
8082
};
8183

84+
componentDidMount() {
85+
// eslint-disable-next-line
86+
const domNode = ReactDOM.findDOMNode(this);
87+
88+
renderMath(domNode);
89+
}
90+
91+
componentDidUpdate() {
92+
// eslint-disable-next-line
93+
const domNode = ReactDOM.findDOMNode(this);
94+
95+
renderMath(domNode);
96+
}
97+
8298
add = () => {
8399
const { model, categories: oldCategories } = this.props;
84100
const { categoriesPerRow, correctResponse, allowAlternateEnabled } = model;

0 commit comments

Comments
 (0)