diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.coffee index 4fd643f43..9a9bad539 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.coffee @@ -454,8 +454,10 @@ class App.TicketZoom extends App.Controller App.TaskManager.touch(@taskKey) if !@renderDone - @renderDone = true - @autosaveLast = {} + @renderDone = true + @autosaveLast = {} + @scrollHeaderPos = undefined + elLocal = $(App.view('ticket_zoom') ticket: @ticket nav: @nav diff --git a/spec/system/ticket/zoom_spec.rb b/spec/system/ticket/zoom_spec.rb index fefd6b484..84603a6e4 100644 --- a/spec/system/ticket/zoom_spec.rb +++ b/spec/system/ticket/zoom_spec.rb @@ -270,6 +270,25 @@ RSpec.describe 'Ticket zoom', type: :system do end end end + + context 'scrollPageHeader disappears when answering via email #3736' do + let(:ticket) do + ticket = create(:ticket, group: Group.first) + create_list(:ticket_article, 15, ticket: ticket) + ticket + end + + before do + visit "ticket/zoom/#{ticket.id}" + end + + it 'does reset the scrollPageHeader on rerender of the ticket' do + select User.find_by(email: 'admin@example.com').fullname, from: 'Owner' + find('.js-textarea').send_keys('test 1234') + find('.js-submit').click + expect(page).to have_selector('div.scrollPageHeader .js-ticketTitleContainer') + end + end end describe 'delete article', authenticated_as: :authenticate do