Skip to content

Commit e322226

Browse files
committed
fix: allow renaming page without explicit save
Rename page on blur of the page entry. Make sure this only happens when we are not in cypress as cypress randomly triggers blur events most likely due to the way it displays the current page within its ui. Fixes #206.
1 parent 9581b30 commit e322226

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/components/Page.vue

+10-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
v-model="newTitle"
1818
class="title"
1919
:placeholder="t('collectives', 'Title')"
20-
type="text">
20+
type="text"
21+
@blur="renamePageOnBlur();">
2122
</form>
2223
<button class="edit-button primary"
2324
:title="edit ? t('collectives', 'Stop editing') : t('collectives', 'Start editing')"
@@ -294,6 +295,14 @@ export default {
294295
this.edit = false
295296
},
296297
298+
renamePageOnBlur() {
299+
// Cypress tests in ci trigger blur events randomly.
300+
if (window.Cypress) {
301+
return
302+
}
303+
return this.renamePage()
304+
},
305+
297306
/**
298307
* Rename currentPage on the server
299308
*/

0 commit comments

Comments
 (0)