Issue with Raycaster and modified BufferGeometry

I have a problem when I dynamically update a vertex in a BufferGeometry. A raycaster does not pick up on the change. Is there something else I need to update or is this a bug?

Tested on both dev and r113 on chrome, firefox, and edge. No difference between them from what I can tell.

jsfiddle demo; Hover over the triangle to extend it.

// This part runs when the mouse hovers over the triangle.
// Update the blue vertex's y position to 5.0
let vertexAttribute = geometry.getAttribute('position');
vertexAttribute.setY(2, 5.0);
vertexAttribute.needsUpdate = true;

Here is a gif of the problem, the raycaster only recognizes the bottom part of the triangle and not the part I extended.

Hi!
Try this:

      let vertexAttribute = geometry.getAttribute('position');
      vertexAttribute.setY(2, 5.0);
      vertexAttribute.needsUpdate = true;
      geometry.computeBoundingSphere(); // add this line
      geometry.computeBoundingBox(); // add this line

Some explanations: [Solved] Raycaster missing half a plane - bug?

3 Likes