Skip to content

chrome initiate two times toolbar.js #25934

Closed
@Bhavik-kumar

Description

@Bhavik-kumar

Preconditions (*)

  1. vanilla Magento CE 2.3.*
  2. chrome browser
  3. vanilla with sample data

Steps to reproduce (*)

  1. got to product list, search or advance search page
  2. open developer tools -> network(tab)(Chrome browser)
  3. Select/click any of the toolbar option like Grid/List, Sort By, or show X per page
  4. Network(Chrome Browser) selected/clicked link triggering two time and because of two time trigger backed doing twice process after canceled one also.
    (for verify put any log in to catalog->product->list controller).

image

Expected result (*)

  1. Link should trigger once only or binding of event make once with
    vendor/magento/module-catalog/view/frontend/web/js/product/list/toolbar.js

Actual result (*)

  1. On click/change link trigger two times

Solution

File: vendor/magento/module-catalog/view/frontend/web/js/product/list/toolbar.js::_create(

 _create: function () {
	if(window.isToolbarLoaded)
		return;

	this._bind($(this.options.modeControl), this.options.mode, this.options.modeDefault);
	this._bind($(this.options.directionControl), this.options.direction, this.options.directionDefault);
	this._bind($(this.options.orderControl), this.options.order, this.options.orderDefault);
	this._bind($(this.options.limitControl), this.options.limit, this.options.limitDefault);

	window.isToolbarLoaded = true;
},

Metadata

Metadata

Assignees

Labels

Area: FrontendComponent: CatalogFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P3May be fixed according to the position in the backlog.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions