Skip to content

Commit

Permalink
Improve URL select for URL prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Komediruzecki authored and Rokt33r committed Apr 13, 2022
1 parent 2300389 commit f385f3a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/cloud/components/Props/Pickers/UrlSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,19 @@ const UrlSelect = ({
)
}, [value])

const openSelectorIfEmpty = useCallback(
(e) => {
if (value.trim() === '' || !isValidUrl(value)) {
openSelector(e)
}
},
[openSelector, value]
)

return (
<UrlSelectContainer>
<PropertyValueButton
onClick={(e) => openSelectorIfEmpty(e)}
sending={sending}
isReadOnly={isReadOnly}
disabled={disabled}
Expand Down

0 comments on commit f385f3a

Please sign in to comment.