If the washer drains immediately as it attempts to fill,or if it has problems with maintaining the water level after it does fill, this can commonly be caused by what is known as "siphoning". The following link explains:
Read through the link provided and let me know if you have any questions. This could be a simple matter of drain hose placement. If this does not correct your problem, please let me know. I hope this helps you.