Fix error when adding tags with keyboard (Fix #4394)