Medium-editor: Adding URLs does not work in Modals

Created on 21 Aug 2014  路  9Comments  路  Source: yabwe/medium-editor

Using Medium-Editor in a modal. Most everything works as expected except URLs. Double-clicking a word to bring up the menu is fine. Clicking the 'url' icon will bring up the 'paste a url' box, however it will not be focused and any attempt to click within the box will close everything. This has been happening on all versions for at least roughly the past 5-6 months back. Same behavior seen in latest Chrome & Firefox on Mac. Using 'pause on exceptions' seems to indicate that everything is missing a generic getAttribute method. Any advice?

Most helpful comment

Okay. Found the issue. Watch out for tabindex="-1". As soon as I removed it, the focus on the url input worked.

All 9 comments

What kind of modal is it? Is it an iframe, or just in a div that gets shown?

I've had a previous experience with this happening not in a modal.

If you could put together an example, I will try with my fork and see if the changes I've made have resolved it.

It's a bootstrap 3 modal, so div... If I get some time today I'll create an example.

Here's my fiddle.
http://jsfiddle.net/efqoqnqe/
I'm going to close the issue as my fiddle seems to imply that my problem is elsewhere. :(

Great :)

I also ran into a similar issue. In one modal it is working, in another modal, the url loses focus. @hilem did you find a solution?

Okay. Found the issue. Watch out for tabindex="-1". As soon as I removed it, the focus on the url input worked.

Which file contains tabindex="-1"? I didn't find it.

My modal had that attribute, and as soon as I removed it, it was working. It might not true for every case, but that's the case I ran into.

@chandrewz Thank you! tabindex removal FTW

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ctrlmaniac picture ctrlmaniac  路  6Comments

jorgedavila25 picture jorgedavila25  路  6Comments

boesie picture boesie  路  4Comments

taiji202 picture taiji202  路  6Comments

ankur0890 picture ankur0890  路  4Comments