Skip to content

Commit d9cf4a5

Browse files
authoredJan 21, 2018
Merge pull request #2273 from plotly/unstrict-events
Allow selection.style getter in event handlers
2 parents bb79fda + 1483331 commit d9cf4a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎test/image/strict-d3.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ selProto.style = function() {
3232

3333
if(sel.size()) {
3434
if(typeof obj === 'string') {
35-
if(arguments.length === 1) {
35+
if(arguments.length === 1 && !d3.event) {
3636
throw new Error('d3 selection.style called as getter: ' +
37-
'disallowed as it can fail for unattached elements. ' +
38-
'Use node.style.attribute instead.');
37+
'disallowed outside event handlers as it can fail for ' +
38+
'unattached elements. Use node.style.attribute instead.');
3939
}
4040
checkStyleVal(sel, obj, arguments[1]);
4141
} else {

0 commit comments

Comments
 (0)
Please sign in to comment.