Prevent only axis stretch/shrink but not shift

Looking at the first example here, there are two actions I can perform when clicking and dragging on the x-axis. Notice how in the picture below, the mouse pointer is in the middle of the x axis.

If I start dragging now, I can move the x-axis left and right, resulting in something like this (note that the x-axis range moved from about [1,2] to about [1.4,2.4]):

However, if I start the dragging process with the mouse pointer at the very beginning or end of the x-axis, I can stretch or shrink the x-axis range (note how the x-axis range grew from [1,2] to about [1,3]):

I am aware that I can call “fig.update_xaxes(fixedrange=True)” to prevent both of these behaviours. However, I only want to disable stretching/shrinking and keep the moving to left and right enabled. In other terms, I want the user to be able to change the x-axis range only while containing a fixed range size.

Is there any way to do this?

I have now found that the correct terminology for this behaviour is zooming and panning.

So, to rephrase my question:
Can I disable only the zoom functionality but keep the pan functionality? Setting fixedrange=True will disable both.

Now this seems to be a duplicate question, already asked here back in 2018. Sadly, this is appearantly still not possible.