lapse in custom UI

using a minecart for a custom GUI and this issue keeps happening where I have to double click the slot where the arrow is to proceed. it only happens sometimes

Continue to help post