Skip to content

Commit

Permalink
docs(exclude): update exclude example to include a class
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil authored and mattnathan committed Jun 17, 2020
1 parent 9cb1e43 commit 2c60e77
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
25 changes: 17 additions & 8 deletions demo/examples/Exclude.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ const anchorStyle: CSSProperties = {
borderColor: '#dd33aa'
}

const lastAnchorStyle = {
...anchorStyle,
top: ANCHOR_TOP + 50
}

export default function Exclude() {
const elem = useRef<HTMLDivElement>(null)
const elemTwo = useRef<HTMLDivElement>(null)
Expand All @@ -59,13 +54,27 @@ export default function Exclude() {
<img style={{ width: '100%', height: '100%' }} src="awesome_tiger.svg" />
<a
style={anchorStyle}
id="link"
target="_blank"
rel="noopener noreferrer"
href="https://timmywil.com/panzoom/">
This link will not allow dragging.
</a>
<a
style={{ ...anchorStyle, top: ANCHOR_TOP + 50 }}
className="custom-excluded-class"
target="_blank"
rel="noopener noreferrer"
href="https://timmywil.com/panzoom/">
This link will also not allow dragging.
</a>
<a
style={{ ...anchorStyle, top: ANCHOR_TOP + 100 }}
target="_blank"
rel="noopener noreferrer"
id="link"
href="https://timmywil.com/panzoom/">
This link will handle the click
This one will allow dragging.
</a>
<a style={lastAnchorStyle}>This one will pass through the event.</a>
<div
ref={elemTwo}
style={{
Expand Down
3 changes: 2 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ interface MiscOptions {
* event.preventDefault()
* }
* })
* // Do nothing (this probably breaks things on mobile tho)
* // Do nothing.
* // This can change dragging behavior on mobile.
* Panzoom(elem, {
* handleStartEvent: () => {}
* })
Expand Down

0 comments on commit 2c60e77

Please sign in to comment.