-
-
Notifications
You must be signed in to change notification settings - Fork 13
Add Autocomplete component #562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
indicator.tabIndex = -1; | ||
} | ||
buttons.append(indicator); | ||
this._indicatorElement = indicator; |
Check warning
Code scanning / CodeQL
Useless assignment to property Warning
another property write
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 1 day ago
To fix the problem, remove the redundant assignment to this._indicatorElement
on line 520 in the _createButtons
method of js/dist/auto-complete.js. Only the second assignment (line 521) should remain, as it is sufficient to set the property. No other changes are needed, and no imports or definitions are required. The fix is a simple deletion of the first assignment.
@@ -520,3 +520,2 @@ | ||
this._indicatorElement = indicator; | ||
this._indicatorElement = indicator; | ||
} |
const selects = SelectorEngine.find(SELECTOR_AUTO_COMPLETE); | ||
for (let i = 0, len = selects.length; i < len; i++) { | ||
const context = Data.get(selects[i], DATA_KEY); | ||
({ |
Check warning
Code scanning / CodeQL
Expression has no effect Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 1 day ago
To fix the issue, the no-op expression should either be removed entirely or replaced with meaningful code if it was intended to serve a specific purpose. Since there is no indication of its intended use, the safest approach is to remove it. This will clean up the code and eliminate the unnecessary expression without altering the existing functionality.
-
Copy modified line R774
@@ -773,5 +773,3 @@ | ||
const context = Data.get(selects[i], DATA_KEY); | ||
({ | ||
relatedTarget: selects[i] | ||
}); | ||
// Removed no-op expression | ||
if (event && event.type === 'click') ; |
indicator.tabIndex = -1; | ||
} | ||
buttons.append(indicator); | ||
this._indicatorElement = indicator; |
Check warning
Code scanning / CodeQL
Useless assignment to property Warning
another property write
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 1 day ago
To fix the issue, we should remove the redundant assignment this._indicatorElement = indicator
on line 559. This will eliminate the unnecessary operation without affecting the program's functionality, as the second assignment on line 560 already sets the correct value.
@@ -559,3 +559,2 @@ | ||
this._indicatorElement = indicator; | ||
this._indicatorElement = indicator; | ||
} |
if (composedPath.includes(context._element)) { | ||
continue; | ||
} | ||
({ |
Check warning
Code scanning / CodeQL
Expression has no effect Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 1 day ago
To fix the issue, the object literal { relatedTarget: context._element }
should either be removed entirely or replaced with meaningful code if it was intended to serve a specific purpose. If the expression was meant to document the structure of an object, it should be assigned to a variable or used in a function call. Alternatively, if the value is deliberately ignored, it should be wrapped in a void
expression to clarify intent.
In this case, since the object literal does not appear to serve any purpose, the best approach is to remove it entirely. This ensures the code remains clean and avoids confusion.
-
Copy modified line R833
@@ -832,5 +832,3 @@ | ||
} | ||
({ | ||
relatedTarget: context._element | ||
}); | ||
// Removed unused object literal | ||
if (event.type === 'click') ; |
} | ||
|
||
buttons.append(indicator) | ||
this._indicatorElement = indicator |
Check warning
Code scanning / CodeQL
Useless assignment to property Warning
another property write
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 1 day ago
To fix the issue, we should remove the redundant assignment this._indicatorElement = indicator
on line 627. This will eliminate the unnecessary code and ensure that the property is only assigned once, on line 628. This change does not affect the functionality of the code, as the first assignment is immediately overwritten.
@@ -627,3 +627,2 @@ | ||
this._indicatorElement = indicator | ||
this._indicatorElement = indicator | ||
} |
No description provided.