Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #215 from FormidableLabs/bug/pressEvents
Browse files Browse the repository at this point in the history
pointerEvents box-none
  • Loading branch information
boygirl authored Dec 19, 2017
2 parents a4bd673 + 4662faa commit 6c4a55f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
26 changes: 25 additions & 1 deletion demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ import {
VictoryPie,
VictoryLabel,
VictoryLegend,
createContainer
createContainer,
VictoryPortal,
Bar
} from "victory-native";

import { VictoryTheme } from "victory-core";
Expand Down Expand Up @@ -948,6 +950,28 @@ export default class Demo extends Component {
]}
/>
</VictoryChart>
<VictoryChart
events={[
{
childName: "bar",
target: "data",
eventHandlers: {
onPressIn: () => {
return [
{
mutation: () => {
return { style: { fill: "orange" } };
}
}
];
}
}
}
]}
>
<VictoryBar name="bar" dataComponent={<VictoryPortal><Bar/></VictoryPortal>}/>
<VictoryAxis tickFormat={["one", "two", "three", "four"]}/>
</VictoryChart>
</ScrollView>
);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/components/victory-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ export default class extends VictoryContainer {
const portalSvgStyle = assign({ overflow: "visible" }, dimensions);
const portalProps = { width, height, viewBox: svgProps.viewBox, style: portalSvgStyle };
return (
<View {...this.panResponder.panHandlers} style={divStyle} touchAction="none"
<View {...this.panResponder.panHandlers} style={divStyle} touchAction="box-none"
className={className} ref={props.containerRef}
>
<Svg {...svgProps} style={dimensions} touchAction="all">
<Svg {...svgProps} style={dimensions}>
{title ? <title id="title">{title}</title> : null}
{desc ? <desc id="desc">{desc}</desc> : null}
{children}
</Svg>
<View style={portalDivStyle} touchAction="none">
<View style={portalDivStyle} touchAction="box-none" pointerEvents="box-none">
<Portal {...portalProps} ref={this.savePortalRef}/>
</View>
</View>
Expand Down

0 comments on commit 6c4a55f

Please sign in to comment.