Say, DIR is connected to “H” and /G is connected to “L” - that defines transmission from A-to-B, but what do you have on the A - side, do you have a pull-up there?
Maybe that’s where the problem lays .. see attached picture ..
If you don’t treat 74LS245 as a tri-state buffer but have the control pins (/G and DIR) connected as mentioned above, the situation with undefined states is on the 74LS245 inputs/switches side ..
In any case, 10k pull-ups should do ..
Rgds,
IanP
:|