0
votes

I am unable to select the text inside the textfield in my Firefox extension. The cursor just stays in the beginning of the textfield and does not move when I click and drag the mouse. However, I am able to select the text using the shift and arrow keys on the keyboard.

I am loading an html page that contains 2 textfields and 2 buttons in an iFrame within a XUL panel.

The code I am using is provided below:

//popup.xul
<?xml version="1.0" encoding="UTF-8"?>
<panel id="ext-popup" title="My Extension" orient="vertical" autostretch="always"
       buttons=","
       defaultButton=","
       shadow="true"
       style="padding: 0px; margin: 0px; height: 32px; -moz-window-shadow : sheet"
       onload="init();"
       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

    <script src="chrome://myext/content/popup.js"/>
    <iframe src="chrome://myext/content/popup.html" type="content"
            style="background-color: white; -moz-window-shadow : default; width: 490px; height: 260px;overflow: hidden;"
            id="popupContent"/>
</panel>

Is there any option that need to set to allow selection in the textfield?

1
Why are you using <panel> as the root tag of a dialog? What if you change that into <window>?Wladimir Palant
@WladimirPalant I wanted to add the html file as the view so assumed that panel would be best. I tried with the window tag as well but that did not make any difference.Vivek

1 Answers

0
votes

Finally found the problem. The problem was with css. I was using the following css attribute:

-moz-user-select: none

When I removed this, I was able to select text.