From 298ff1dee0e7f51898c8cd59ca0fb5c817ab607c Mon Sep 17 00:00:00 2001 From: Akshay Kumar Sharma Date: Sun, 30 Sep 2018 18:26:07 +0530 Subject: [PATCH] preventing the default behaviour of all the formatting button. --- src/pell.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pell.js b/src/pell.js index 3e2fe64..bb30d1c 100644 --- a/src/pell.js +++ b/src/pell.js @@ -140,7 +140,10 @@ export const init = settings => { button.innerHTML = action.icon button.title = action.title button.setAttribute('type', 'button') - button.onclick = () => action.result() && content.focus() + button.onclick = (e) => { + action.result() && content.focus() + e.preventDefault() + } if (action.state) { const handler = () => button.classList[action.state() ? 'add' : 'remove'](classes.selected)