diff --git a/apps/documenteditor/mobile/src/controller/edit/EditParagraph.jsx b/apps/documenteditor/mobile/src/controller/edit/EditParagraph.jsx index 1bb1e8019..20aabc0a4 100644 --- a/apps/documenteditor/mobile/src/controller/edit/EditParagraph.jsx +++ b/apps/documenteditor/mobile/src/controller/edit/EditParagraph.jsx @@ -6,12 +6,14 @@ class EditParagraphController extends Component { constructor (props) { super(props); props.storeParagraphSettings.setBackColor(undefined); + this.onStyleClick = this.onStyleClick.bind(this); } onStyleClick (name) { const api = Common.EditorApi.get(); if (api) { api.put_Style(name); + this.props.storeParagraphSettings.changeParaStyleName(name); } } diff --git a/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx b/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx index 8292b4e13..6beff21c0 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx @@ -1,4 +1,5 @@ import React, {Fragment, useState} from 'react'; +import { flushSync } from 'react-dom'; import {observer, inject} from "mobx-react"; import {f7, List, ListItem, Icon, Button, Page, Navbar, NavRight, Segmented, BlockTitle, Toggle, Link} from 'framework7-react'; import { useTranslation } from 'react-i18next'; @@ -229,7 +230,11 @@ const EditParagraph = props => { key={index} radio checked={curStyleName === style.name} - onClick={() => {props.onStyleClick(style.name)}} + onClick={() => { + if(curStyleName !== style.name) { + props.onStyleClick(style.name); + } + }} >