it usually doesn't happen like that. it is just that the screen is too sensitive to touch. so, even slightest wrong movement slides it sidewise instead of upwards. this also happens if the fingers are wet or there is something on the screen or the screenguard is bad. these are external causes. now if it is not any of these, try soft resetting your phone. also, is this problem limited to WhatsApp? or all other apps? if it is one only, you might consider reinstalling.