Accepted answer

You shouldn't save the result of an enter selection and use it like that. It works fine it you select from the canvas, see here. The reason is that elements in the enter selection merge into the update selection once DOM elements have been appended.

Related Query

More Query from same tag