Hi,

I am working with module, I found the username ('content/bulkauthorupdate') autocomplete field is not working properly and onclick on outside the field, drop down is not getting closed.

I am wondering that Drupal form api autocomplete is better than using js.

Thanks,
Harish

Comments

harish b created an issue. See original summary.

silvi.addweb’s picture

Status: Active » Needs review
StatusFileSize
new527 bytes

PFA patch to resolve an issue.

harish b’s picture

StatusFileSize
new43.66 KB

Hi Tejal Patel,

Thanks for your patch, I reviewed it but autocomplete complete not working properly.

Scenario: When i gave two letters input in auto complete field. Suggestions are working properly in drop down but after selecting one of the user, Drop down should close automatically.

Changing status to Needs Work.

Thanks,
Harish

silvi.addweb’s picture

Hi @harish,

Thanks for your reply. This is working fine for me. Can you please check console error and tell me please which jquery version you used.

harish b’s picture

Hi Tejal,

I am getting error that (jQuery(...).live is not a function). I got related issue on stackoverflow follows below::

jQuery .live() has been removed in version 1.9 onwards.

That means if you are upgrading from version 1.8 and earlier, you will notice things breaking if you do not follow the migration guide below. You must not simply replace .live() with .on()!

Read before you start doing a search and replace:

For quick/hot fixes on a live site, do not just replace the keyword live with on,
as the parameters are different!

.live(events, function)
should map to:

.on(eventType, selector, function)
The selector is very important! If you do not need to use this for any reason, set it to null.

Migration Example 1:

before:

$('#mainmenu a').live('click', function)
after, you move the child element (a) to the .on() selector:

$('#mainmenu').on('click', 'a', function)

nitin.k’s picture

Status: Needs review » Active

Thanks everyone for being here, looks like our module is gaining popularity.
#5: The JQuery version for click event is fixed up. So it will work for all versions of JQuery. Download the latest code.

Meanwhile I am looking autocomplete things.

silvi.addweb’s picture

Status: Active » Needs review
StatusFileSize
new669 bytes

@harish,

The patch I previously provided uses correct syntax for on(). The problem is something else.

The module code has changed yesterday and now it includes check for jquery version. Refer to commit here.

In this commit, parseFloat() is used but it returns 1.1 in case you are using 1.10.2 for example, that breaks the functionality.

Attached patch solves this issue.

  • nitin.k committed 5084261 on 7.x-1.x
    #2820314, #2820339 issues resolved.
    
nitin.k’s picture

Status: Needs review » Active

#7: Click event has been handled separately. We should not get this anymore. Please check latest dev code.

silvi.addweb’s picture

Latest dev version is working fine. It looks like click event is completely rewritten in dev version. Therefore this patch is not required anymore.

nitin.k’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.