Skip to content

Commit

Permalink
Fix example code in README.md (#18158)
Browse files Browse the repository at this point in the history
* Fix example code in README.md

As mentioned in #16916, it seems not to work to add "draggable" attribute directly to Dashicon. The example works when the Dashicon is wrapped in a div.

* Fix tabbing issue
  • Loading branch information
bastibeckr authored and talldan committed Dec 3, 2019
1 parent e12d4dd commit 5064a06
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions packages/components/src/draggable/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,17 @@ const MyDraggable = () => (
elementId="draggable-panel"
transferData={ { } }
>
{
( { onDraggableStart, onDraggableEnd } ) => (
<Dashicon
icon="move"
onDragStart={ onDraggableStart }
onDragEnd={ onDraggableEnd }
draggable
/>
)
}
{
( { onDraggableStart, onDraggableEnd } ) => (
<div className="example-drag-handle" draggable>
<Dashicon
icon="move"
onDragStart={ onDraggableStart }
onDragEnd={ onDraggableEnd }
/>
</div>
)
}
</Draggable>
</PanelBody>
</Panel>
Expand All @@ -83,16 +84,17 @@ const MyDraggable = ( { onDragStart, onDragEnd } ) => (
onDragStart={ onDragStart }
onDragEnd={ onDragEnd }
>
{
( { onDraggableStart, onDraggableEnd } ) => (
<Dashicon
icon="move"
onDragStart={ onDraggableStart }
onDragEnd={ onDraggableEnd }
draggable
/>
)
}
{
( { onDraggableStart, onDraggableEnd } ) => (
<div className="example-drag-handle" draggable>
<Dashicon
icon="move"
onDragStart={ onDraggableStart }
onDragEnd={ onDraggableEnd }
/>
</div>
)
}
</Draggable>
</PanelBody>
</Panel>
Expand Down

0 comments on commit 5064a06

Please sign in to comment.