Presumably, I know where's the problem but I have no idea how to fix it. I've got an editable div and <small> elements, clicking on which I want text (that was selected) to be styled. But the problem is it doesn't seem to work at all. Moreover, It wasn't working on further text I was typing until I explicitly added focus on that div. I do think it happens in due to <small> elements, instead of <button>. However, as I've mentioned before, I don't know how to fix it. I've already tried to add ranges in selection, but it didn't make any change. Does anybody know how to fix this nuisance, without changing elements on buttons?
-
Can you add what you've tried already? It'll make it much easier for us to assist you.Zachary Haber– Zachary Haber2020-05-26 14:34:51 +00:00Commented May 26, 2020 at 14:34
-
It works properly when execCommand triggers after I click on buttons, but doesn't if I click on <small> elements. I'm sure that it happens, cuz <small> elements get selected, but so far I've not found any way to prevent this behaviorh1kiga– h1kiga2020-05-26 14:39:55 +00:00Commented May 26, 2020 at 14:39
-
That seems that It's not about selectionh1kiga– h1kiga2020-05-26 14:56:08 +00:00Commented May 26, 2020 at 14:56
-
Can you add the code that have have? Part of asking questions about code is adding a minimal, reproducable example.Zachary Haber– Zachary Haber2020-05-26 15:05:15 +00:00Commented May 26, 2020 at 15:05
-
I think that this command is not going to work with such elements as <small>. I found a few examples of stuff I want to implement and all of them don't work, when I change buttons/img on the others elementsh1kiga– h1kiga2020-05-26 15:19:38 +00:00Commented May 26, 2020 at 15:19
Add a comment
|