mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 12:57:29 +08:00
FIX: ensures thread panel closes on escape (#29651)
`chatThreadPane.isOpened` was returning `false` when it should return `true` due to an incorrect matching on the route. Note that visiting a thread will focus the composer and the first escape will blur the input, only the second will close the panel.
This commit is contained in:
parent
5a00a041f1
commit
fc5c0270f7
|
@ -10,7 +10,10 @@ export default class ChatThreadPane extends ChatChannelPane {
|
|||
}
|
||||
|
||||
get isOpened() {
|
||||
return this.router.currentRoute.name === "chat.channel.thread";
|
||||
return (
|
||||
this.router.currentRoute.name === "chat.channel.thread" ||
|
||||
this.router.currentRoute.name === "chat.channel.thread.index"
|
||||
);
|
||||
}
|
||||
|
||||
get selectedMessageIds() {
|
||||
|
|
|
@ -28,6 +28,14 @@ RSpec.describe "Chat | composer | shortcuts | thread", type: :system do
|
|||
expect(side_panel_page).to have_open_thread
|
||||
end
|
||||
end
|
||||
|
||||
it "closes the thread panel" do
|
||||
chat_page.visit_thread(thread_1)
|
||||
thread_page.composer.cancel_shortcut # ensures we are not focused in the composer
|
||||
page.send_keys(:escape)
|
||||
|
||||
expect(side_panel_page).to have_no_open_thread
|
||||
end
|
||||
end
|
||||
|
||||
describe "ArrowUp" do
|
||||
|
|
Loading…
Reference in New Issue
Block a user