Unable to click on button when the date picker is appeared on the screen

Broadly speaking, you have two choices:

  1. Click somewhere outside the datepicker. This will usually remove focus from it and hide it.

  2. Send/trigger a blur event on the datepicker element.

First choice is probably easiest.

To advise you any further I need a lot more information. Read this post for ideas: