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

View File

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

View File

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