Fix a bug where the beforeChange was not well handed with endEdit()