From 1483331cd212df1468dd427b5e5ccc1cbdd86909 Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Fri, 19 Jan 2018 21:15:26 -0500 Subject: [PATCH] allow selection.style getter in event handlers --- test/image/strict-d3.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/image/strict-d3.js b/test/image/strict-d3.js index a35a80fddba..44197876c94 100644 --- a/test/image/strict-d3.js +++ b/test/image/strict-d3.js @@ -32,10 +32,10 @@ selProto.style = function() { if(sel.size()) { if(typeof obj === 'string') { - if(arguments.length === 1) { + if(arguments.length === 1 && !d3.event) { throw new Error('d3 selection.style called as getter: ' + - 'disallowed as it can fail for unattached elements. ' + - 'Use node.style.attribute instead.'); + 'disallowed outside event handlers as it can fail for ' + + 'unattached elements. Use node.style.attribute instead.'); } checkStyleVal(sel, obj, arguments[1]); } else {