I want to lock a gradient within a shape so that when I expand the shape the gradient stays in place. I have had this issue for as long as I can remember. The only way I can get around this is to copy and mirror the shape next to it and create a clipping mask of the shape that I want. Locking a gradient in place would save me a lot of time.
Things seem to be working ok my end, which version of Illustrator are you using?
If I have misunderstood your problem, can you post up a screenshot?
I'm afraid, there is no way to fix it: you set the gradient relative to the shape's edges. So, when you change the shape, you move the starting and ending points of the gradient. If you need the gradient to be set before the shape changes, I would add the guides to fix the start and endpoints of the gradient relative to the artboard (and current shape's position), and correct them after all other actions.
Thank you for your reply. I know that there is no way to fix it. Which is why I taged the post it as "feature request".