Skip to content

Commit

Permalink
fix: fix "previous versions" button failing after transpose
Browse files Browse the repository at this point in the history
this change stops the button from refreshing (or being replaced) and losing its event listener for opening the modal.
  • Loading branch information
Samuelodan committed Aug 10, 2024
1 parent 62763e4 commit 1c3b91f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/chord_sheets/_main.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ turbo-frame[id=dom_id(chord_sheet) data-controller="clipboard chord-diagram moda
span.icon
i.fas.fa-arrow-circle-down

.level-right.align-items-space-between
.level-right.align-items-space-between#level-right[data-turbo-permanent]
.level-item.mt-2 data-chord-diagram-target="wrapper"
= render("chord_diagram_icon")
.hidden#diagram-select data-chord-diagram-target="selectBox"
Expand Down
7 changes: 7 additions & 0 deletions spec/cypress/e2e/chord_sheets.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ describe("Undoing changes", () => {
cy.get("#versions").click()

cy.contains("My amazing song")

cy.get(".modal-close").click()
cy.get("#transpose-up").click() // even after transposing

cy.get("#versions").click()

cy.contains("My amazing song")
})

it("allows the user to restore a previous version", () => {
Expand Down

0 comments on commit 1c3b91f

Please sign in to comment.