Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
fix: buttons will click now
Browse files Browse the repository at this point in the history
  • Loading branch information
okdistribute committed Feb 17, 2020
1 parent 27512f9 commit f3aceb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
11 changes: 1 addition & 10 deletions app/components/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,7 @@ import React from 'react'
import styled from 'styled-components'

const BaseButton = styled.button.attrs(props => ({
...props,
onClick: props => {
if (props.trigger) {
return function (e) {
e.stopPropagation()
props.trigger.apply(this, [e])
}
}
return undefined
}
...props
}))`
text-transform: uppercase;
letter-spacing: 0.025em;
Expand Down
5 changes: 4 additions & 1 deletion app/components/finder-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const FinderButton = ({ dat, onClick }) => (
<Button.Icon
icon={<Icon name='open-in-finder' />}
className='row-action btn-finder'
trigger={() => shell.openExternal(`file://${resolve(dat.path)}`, () => {})}
onClick={(ev) => {
ev.stopPropagation()
shell.openExternal(`file://${resolve(dat.path)}`, () => {})
}}
/>
)

Expand Down

0 comments on commit f3aceb9

Please sign in to comment.