Merge pull request #5532 from KDSBrowne/xx.fix-whiteboard-textarea-flicker

Prevent whiteboard textarea flickering
This commit is contained in:
Anton Georgiev 2018-05-15 09:34:03 -04:00 committed by GitHub
commit f2cc11b08d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -138,9 +138,11 @@ export default class TextDrawComponent extends Component {
renderViewerTextShape(results) {
const styles = TextDrawComponent.getViewerStyles(results);
const { isChrome, isEdge } = this.props.browserType;
return (
<g>
{ isChrome || isEdge ? null :
<clipPath id={this.props.annotation.id}>
<rect
x={results.x}
@ -149,7 +151,7 @@ export default class TextDrawComponent extends Component {
height={results.height}
/>
</clipPath>
}
<foreignObject
clipPath={`url(#${this.props.annotation.id})`}
x={results.x}

View File

@ -1,5 +1,6 @@
import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import deviceInfo from '/imports/utils/deviceInfo';
import TextShapeService from './service';
import TextDrawComponent from './component';
@ -20,5 +21,6 @@ export default withTracker((params) => {
isActive,
setTextShapeValue: TextShapeService.setTextShapeValue,
resetTextShapeActiveId: TextShapeService.resetTextShapeActiveId,
browserType: deviceInfo.browserType(),
};
})(TextDrawContainer);

View File

@ -18,6 +18,7 @@ const deviceInfo = {
isChrome: !!window.chrome && !!window.chrome.webstore,
isFirefox: typeof InstallTrigger !== 'undefined',
isIE: 'ActiveXObject' in window,
isEdge: !document.documentMode && window.StyleMedia,
};
},
osType() {