A spesific keybinding applies to all text_editors while it should not

Hello, I have 3 different TextEditors in my app.

let editor_1 = text_editor(&self.t1_content)
    .placeholder("Default text...")
    .on_action(Message::T1ContentChanged)
    .key_binding(editor_kp_bindings);

let editor_2 = text_editor(&self.t2_content)
    .placeholder("Default text...")
    .on_action(Message::T2ContentChanged)
    .key_binding(editor_kp_bindings);

let editor_3 = text_editor(&self.t3_content)
    .placeholder("Default text...")
    .on_action(Message::T3ContentChanged)
    .key_binding(editor_kp_bindings);

And editor_kp_bindings:

pub fn editor_kp_bindings(kp: KeyPress) -> Option<Binding<Message>> {
    let bnd: Option<Binding<Message>> =
        if kp.key == Key::Named(Named::Enter) && kp.modifiers.shift() {
            let c1 = Binding::Insert::<Message>('\n');
            let c2 = Binding::Insert::<Message>('/');
            let c3 = Binding::Insert::<Message>('/');
            let c4 = Binding::Insert::<Message>('\n');

            Some(Binding::Sequence(vec![c1, c2, c3, c4]))
        } else if kp.key == Key::Named(Named::Enter) {
            None
        } else if kp.key == Key::Named(Named::Delete) {
            Some(Binding::Delete)
        } else {
            Binding::from_key_press(kp)
        };
    bnd
}

When I press SHIFT + ENTER, all three editors inserts “\n//\n” (All of the Message::T1ContentChanged, Message::T2ContentChanged, Message::T3ContentChanged firing) but I want only focused/current text editor to insert this. This behaviour does not happen with any other key presses. Where am I doing wrong? I really don’t understand.

I agree that it is a bit confusing that the key_binding callback for the text_editor is receiving all global key presses, also if the text_editor doesn’t have focus. But the text_editorfrom_event is just checking if the widget has focus and is setting the status flag of KeyPress. I don’t see why it doesn’t act on it.

Anyway, I guess the callback thus has to do what from_key_press does and explicitly filter on whether the text_editor has focus:

                    && matches!(
                        kp.status,
                        text_editor::Status::Focused { .. }
                    )