Skip to content

Conversation

@yezhizhen
Copy link
Contributor

When we call

pub fn send_keys(text: &str) -> Vec<Event> {
with "\u{e008}y", we would always end up with panic.

We should avoid unwarp here.

See: servo/servo#41007 (comment)

actions.sort_unstable();
for action in actions {
result.push(self.dispatch_keyup(action).unwrap().into());
// When we `dispatch_typeable`, we may have already dispatched keyup
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happens at

result.push(self.dispatch_keyup('\u{E008}').unwrap().into());
.

@madsmtm madsmtm added the bug label Dec 15, 2025
Copy link
Member

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you add a test case?

@yezhizhen
Copy link
Contributor Author

Thanks! Could you add a test case?

You mean unit-test right? I will check the rule here :)

@madsmtm
Copy link
Member

madsmtm commented Dec 15, 2025

You mean unit-test right?

That is what I meant, yeah. I know that there aren't any atm.

Signed-off-by: Euclid Ye <[email protected]>
@yezhizhen yezhizhen requested a review from madsmtm December 16, 2025 04:10
@yezhizhen
Copy link
Contributor Author

Done. Pls kindly check :)

@madsmtm
Copy link
Member

madsmtm commented Dec 16, 2025

Thanks!

@madsmtm madsmtm merged commit b2c511a into rust-windowing:main Dec 16, 2025
4 of 5 checks passed
@yezhizhen yezhizhen deleted the do-not-unwrap branch December 17, 2025 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants