Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor position bug in firefox #234

treblam opened this issue May 28, 2014 · 13 comments


None yet
9 participants
Copy link

commented May 28, 2014

Make an editor with empty text. Then focus the editor in firefox, the cursor position is higher than the placeholder. Then I input some text in it, the cursor position become normal.


This comment has been minimized.

Copy link

commented Jun 5, 2014

This seems to be a firefox issue see:

@daviferreira daviferreira added the bug label Jun 5, 2014


This comment has been minimized.

Copy link

commented Jul 12, 2014

Workaround: Instead of letting the contentEditable div be completely empty, put in a <br/>. The placeholder text still shows and everything is in the right position.


This comment has been minimized.

Copy link

commented Nov 17, 2014

@chanon This apparently solves the problem but once you start writing on the inspector we can see the text is placed outside the inner elements of the editor container, and loosing it's proper style:


This comment has been minimized.

Copy link

commented Nov 17, 2014

@treblam have you found a better way to solve this problem ? chanon's suggestion isn't working for me...


This comment has been minimized.

Copy link

commented Nov 20, 2014

@antoniobrandao Yes. I found this bug is caused by the pseudo element of placeholder, so fixed it by replace the pseudo element of placeholder with a div, and I've made a pull request to this repository, but unfortunately it was declined. You can see my changes here:


This comment has been minimized.

Copy link

commented Dec 8, 2014

I can confirm that this is not a firefox issue. This screenshot is taken from IE 10.

medium editor


This comment has been minimized.

Copy link

commented Dec 18, 2014

So, it is a Firefox AND Internet Explorer issue ?


This comment has been minimized.

Copy link

commented Dec 19, 2014

Yeah, it would appear to be that way.

@nmielnik nmielnik removed the bug label Jun 22, 2015


This comment has been minimized.

Copy link

commented Jul 10, 2015

I was not able to reproduce this anymore, please re-open and include more repro steps if anyone is still have this issue.

@nmielnik nmielnik closed this Jul 10, 2015


This comment has been minimized.

Copy link

commented Nov 23, 2015

Unfortunately this still seems like an issue in 5.10.0 using Firefox and the placeholder hideOnClick: false option 😢 :



@nmielnik nmielnik reopened this Dec 4, 2015

@nmielnik nmielnik added the bug label Dec 4, 2015


This comment has been minimized.

Copy link

commented May 26, 2016

any news regarding this issue? just found it and it's really really difficult to fix. our website uses lots of the editable function and it looks so strange in firefox.


This comment has been minimized.

Copy link

commented May 28, 2016

I moved to Trix because of this issue.


This comment has been minimized.

Copy link

commented May 29, 2016

The behavior in firefox is being tracked as a bug:, still looking through workarounds as it looks like a bunch of folks have run into this with contenteditable

nmielnik added a commit that referenced this issue Jun 4, 2016

nmielnik added a commit that referenced this issue Jun 4, 2016

nmielnik added a commit that referenced this issue Jun 6, 2016

@j0k3r j0k3r closed this in a1c2f80 Jun 17, 2016

j0k3r added a commit that referenced this issue Jun 17, 2016

Merge pull request #1113 from yabwe/fix-234
Fix #234 - Cursor rendering incorrectly in firefox

rvetere added a commit to rvetere/medium-editor that referenced this issue Jul 9, 2016

merge newest changes into our fork (#2)
* First ugly draft

Pasting works, second pasting fails.

* Log, log everything

* Revert change on dist file

* Revert some unecessary code change

* Fix jslint issues and errors thrown during tests

* Get custom paste working for every paste

* Get rid of the console logs from paste extension

* paste-handling: remove some member variables from paste handler

* paste-handling: re-enable default paste handling + remove keyboard timing

* paste-handling: use clipboard helper for regular paste + remove hasContentType helper

* paste-handling: revert demo

* paste-handling: Refactor handlePasteBinPaste to look similar to handlePaste

* paste-handling: refactor and reduce two paste handling paths

* ignore .idea

* Prevent Firefox NS_ERROR_FAILURE: on keyup

In Firefox if the editable is a node without children, then NS_ERROR_FAILURE: error thrown for every keyup until it gets a child node. 

Issue: yabwe#994

* Update core.js

* paste-handling: convert trimHTML into replacements

* Reuse selectRange helper method in other places

* paste-handling: extract methods that shouldn't be part of paste handler api

* Convert spaces to %20 in links if linkValidation is true for the anchor extension

* Added separate test verification if linkValidation is false

* Used encodeURI instead of replacing strings to catch other unwanted characters

* Updated documentation for linkValidation encoding update

* Rename

* Add instructions for running tests on external fork PRs in saucelabs

* Updated test - Made the diff between input and validUrl only spaces

* Make correction to external fork steps

* Fix anchor test failure due to cross-browser issues

* paste-handling: Add first test for paste-bin

* paste-handling: cleanup pasteBin and fix defaultPrevented check

* paste-handling: Add some more core tests for keyboard paste

* paste-handling: Add tests to fully cover new functionality

* Fix IE bugs

* 5.15.1

* make event functions chainable

* allow multiple targets in attachDOMEvent and detachDOMEvent

* update docs

* Re-organize content.spec.js a bit

* Add Test and comment for fix for yabwe#994

*  Fix yabwe#1047 - Add 'positionedToolbar' custom event (yabwe#1050)

* Add failing test to reproduce yabwe#1047

* Fix yabwe#1047 - introduce positionedToolbar custom event

* Add tests for positionedToolbar custom event

* Add positionedToolbar to events documentation

* Reference bug number in anchor-preview test

* Fix typo in positionedToolbar event documentation

* 5.16.0

* replace break-all with break-word

* 5.16.1

* add issue and PR templates

* add jsbin and codepen to example link

* fix typo

* Fix yabwe#942 Add core checkContentChanged method and use it for button example

* Add tests for covering checkContentChanged

* Almost final attempt

* Update documentation for addElements and removeElements

* Standardize usage of array operation helpers for dyn-add-elements

* Get rid of reRunSetupListener and refactored setupListener's "editableInput" case. Also removed unnecessary functions in core and moved guid to utils

* Add textarea tests for addElements

* Convert elements into array for addElements and removeElements

* Refactor core internal helpers to not require 'this' references

* Add tests to cover destroy/setup bug with dynamic added/removed elements

* Support selector and nodelist for addElements + removeElements

* Don't worry about setup/destroy for add/removeElements just yet

* Add tests for calling removeElements with textareas

* Make sure textareas are cleaned up correctly in removeElements

* Add more add/remove elements examples to README

* Add more add/remove elements tests, including event handlers

* Add test for dynamically adding disable-return element

* Extract initElement helper from initElements

* Move textarea initializing into initElement

* Move attaching existing events to elements into initElement

* Have setup use addElements to share common code path

* Rename events.attachAllEvents for consistency

* Remove unneeded addElement method

* execActionInternal should pass opt to document.execCommand if action not match internal action

* Add test to verify fix for yabwe#869

* Add regex to paste to remove supportLists comment from Word

* 5.17.0

* Fix null pointer during the cleanupElement event

I ran into an issue that after manually adding elements to the editor (through addElements), and later deleting them again there (through removeElements) was a TypeError being thrown.

It appears that contentCache is not set when only using dynamically added elements, thus while removing that element it will run into an error resulting the element not being removed properly.

This checks if contentCache is set.

* Update events.js

* Update events.js

* Update events.js

* refactor MediumEditor.execAction to use opts.value as an argument pass through document.execCommand

* Fix failures from new tests in IE & Edge

* Deprecate .url, .size, and .name for execAction

* Update with more details about arguments

* Add test to ensure bc for .url option for createLink

* 5.18.0

* Add test to ensure editablePaste is triggered on keyboard paste

* Add test to verify editablePaste is triggered on normal paste

* Ensure editablePaste is triggered on keyboard paste

* Ensure editablePaste always gets consistent data when called

* Allow preview to be shown on empty links

* 5.19.1

* Update tests to ensure unique ids when timestamp is same

* Remove broken code for adding index to textarea-div id

* Add the id of the editor instance to each element

* Add tests for removing element attr on destroy

* Add getEditorFromElement static helper

* Add getEditorByElement and version to API documentation

* Add getContent helper method

* Add documentation for getContent method

* documented the showOnEmptyLink option

* Add resetContent helper method

* Add documentation for resetContent

* Respect form.reset for textareas

* Fix bug in resetContent logic

* Add grunt to local packages and create NPM build script

* Add getInteractionElements to extension contract for preventing blur

* Add test failure for yabwe#1105

* Fix yabwe#1105

* Add documentation for getInteractionElements for extensions

* 5.20.0

* Fix test failure in Chrome 51

* Use class selector instead attribute selector

* Update tests to expect new medium-editor-element class

* Fix yabwe#234 - Cursor rendering incorrectly in firefox

* Improve documentation for toolbar.relativeContainer option

* Work around firefox test case failing in saucelabs only

* 5.20.2

* Add addElement custom event when elements are added

* Add documentation for addElement custom event

* Fix bug in paste handler introduced by 8bd8f8f

* Expose removeElement custom event

* Ensure placeholder extension initializes dynamically added elements

* Ensure placeholder extensions cleans up removed elements

* Undo changes from 8bd8f8f

* yabwe#1123 Fixes issue with electron environment

* 1123, adds strict check for object

* yabwe#1127 | Placeholder is visible when only empty table is in Editor.

* yabwe#1127 | Add Test cases

* 5.21.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.