| Summary: | The regexp check for shortcuts MnemonicData detection is not sufficient | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-qqc2-desktop-style | Reporter: | ratijas <me> |
| Component: | general | Assignee: | Marco Martin <notmart> |
| Status: | ASSIGNED --- | ||
| Severity: | normal | CC: | ahiemstra, kde, nate, noahadvs |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/qqc2-desktop-style/-/merge_requests/241 |
SUMMARY This code is problematic: Shortcut { //in case of explicit & the button manages it by itself enabled: !(RegExp(/\&[^\&]/).test(controlRoot.text)) It does not handle even what it's directly supposed to: an ampersand but not a double ampersand. This snippet is duplicated across several controls. It should be fixed by rewriting into native (C++) code. STEPS TO REPRODUCE 1. console.log(!(RegExp(/\&[^\&]/).test("Yaha && ha!"))) OBSERVED RESULT false EXPECTED RESULT true ADDITIONAL INFORMATION Affected components are: - Button.qml - CheckBox.qml - MenuBarItem.qml - MenuItem.qml - RadioButton.qml - Switch.qml - TabButton.qml - ToolButton.qml