As per the documentation,
if you want to differantiate blank input and cancel event, you can check the value, you receive in the callback. When user has entered nothing and clicks OK, blank string will be there as value. And when user clicks Cancel, the value will be null.