method on_text_changed =
      if ignore_text_changed then
        ()
      else
        on_text_changed ()