Skip to content

Commit f554c62

Browse files
committed
fix the issue with create button due to react select
1 parent f69af43 commit f554c62

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/common/header/HeaderWithCreateButton/HeaderWithCreateButton.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useContext, useState } from 'react'
1+
import React, { SyntheticEvent, useContext, useState } from 'react'
22
import { useHistory, useLocation, useParams } from 'react-router-dom'
33
import { Modal } from '@devtron-labs/devtron-fe-common-lib'
44
import PageHeader from '../PageHeader'
@@ -17,7 +17,10 @@ export default function HeaderWithCreateButton({ headerName, isSuperAdmin }) {
1717
const { serverMode } = useContext(mainContext)
1818
const [showCreateSelectionModal, setShowCreateSelectionModal] = useState(false)
1919

20-
const handleCreateButton = () => {
20+
const handleCreateButton = (e?: SyntheticEvent) => {
21+
// This is added to prevent the further propagation of the event
22+
// It was causing issues with the react select dropdown
23+
e?.stopPropagation()
2124
setShowCreateSelectionModal((prevState) => !prevState)
2225
}
2326

0 commit comments

Comments
 (0)