You are right about how tablets are supposed to work.
The problem is that in your examples this behavior no longer functions as expected on tablets.
The example should work well for both desktop and tablet. Your current implementation changes the normal behavior on tablets.