Skip to content

Commit 7c52e1a

Browse files
committed
fix: grab correct element propert; callback uses evt instead of undefined
1 parent bece065 commit 7c52e1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/CornerstoneViewport/CornerstoneViewport.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,12 @@ class CornerstoneViewport extends Component {
323323

324324
// Enable the DOM Element for use with Cornerstone
325325
const onElementEnabled = function(evt) {
326-
const enabledElement = evt.detail;
326+
const enabledElement = evt.detail.element;
327327
console.warn('no match');
328328
if (enabledElement === this.element) {
329329
console.warn('match');
330330
if (this.props.onElementEnabled) {
331-
this.props.onElementEnabled(event);
331+
this.props.onElementEnabled(evt);
332332
}
333333
cornerstone.events.removeEventListener(
334334
cornerstone.EVENTS.ELEMENT_ENABLED,

0 commit comments

Comments
 (0)