Skip to content

Commit

Permalink
Merge pull request #2273 from plotly/unstrict-events
Browse files Browse the repository at this point in the history
Allow selection.style getter in event handlers
  • Loading branch information
alexcjohnson committed Jan 21, 2018
2 parents bb79fda + 1483331 commit d9cf4a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/image/strict-d3.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d9cf4a5

Please sign in to comment.