fix: disable multiple selection of components while comments feature is toggled on (#4470)

* fix: disable multiple selection of components while comments feature is toggled on

* fix: add nullish collesion check
This commit is contained in:
Gandharv 2022-10-19 09:29:04 +07:00 committed by GitHub
parent 6309dddae3
commit 94714ecf9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 19 deletions

View file

@ -1337,24 +1337,26 @@ class EditorComponent extends React.Component {
isSaving={this.state.isSaving}
isUnsavedQueriesAvailable={this.state.isUnsavedQueriesAvailable}
/>
<Selecto
dragContainer={'.canvas-container'}
selectableTargets={['.react-draggable']}
hitRate={0}
selectByClick={true}
toggleContinueSelect={['shift']}
ref={this.selectionRef}
scrollOptions={this.state.scrollOptions}
onSelectStart={this.onAreaSelectionStart}
onSelectEnd={this.onAreaSelectionEnd}
onSelect={this.onAreaSelection}
onDragStart={this.onAreaSelectionDragStart}
onDrag={this.onAreaSelectionDrag}
onDragEnd={this.onAreaSelectionDragEnd}
onScroll={(e) => {
this.canvasContainerRef.current.scrollBy(e.direction[0] * 10, e.direction[1] * 10);
}}
></Selecto>
{!showComments && (
<Selecto
dragContainer={'.canvas-container'}
selectableTargets={['.react-draggable']}
hitRate={0}
selectByClick={true}
toggleContinueSelect={['shift']}
ref={this.selectionRef}
scrollOptions={this.state.scrollOptions}
onSelectStart={this.onAreaSelectionStart}
onSelectEnd={this.onAreaSelectionEnd}
onSelect={this.onAreaSelection}
onDragStart={this.onAreaSelectionDragStart}
onDrag={this.onAreaSelectionDrag}
onDragEnd={this.onAreaSelectionDragEnd}
onScroll={(e) => {
this.canvasContainerRef.current.scrollBy(e.direction[0] * 10, e.direction[1] * 10);
}}
></Selecto>
)}
<div className="main main-editor-canvas" id="main-editor-canvas">
<div
className={`canvas-container align-items-center ${!showLeftSidebar && 'hide-sidebar'}`}

View file

@ -100,7 +100,7 @@ const Mentions = ({ searchUser, value = '', setValue, setMentionedUsers, placeho
textTransform: 'uppercase',
}}
>
{suggestion.first_name.slice(0, 1) + suggestion.last_name.slice(0, 1)}
{suggestion?.first_name.slice(0, 1) + suggestion?.last_name.slice(0, 1)}
</div>
<div
style={{