fix: fix searchbox carousel navigation behaviour#21141
fix: fix searchbox carousel navigation behaviour#21141
Conversation
Merge Checks Failed |
spartacus
|
||||||||||||||||||||||||||||
| Project |
spartacus
|
| Branch Review |
CXCDS-17219
|
| Run status |
|
| Run duration | 03m 38s |
| Commit |
|
| Committer | Konrad Dzikowski |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
5
|
|
|
0
|
|
|
0
|
|
|
101
|
| View all changes introduced in this branch ↗︎ | |
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Actually this can be breaking change for customers, example:
Customer registered event listener, something like: this.el.nativeElement.addEventListener('focus', this.onFocus, true); and implement some custom logic on focus.
When you are adding (mousedown)="preventDefault($event)" it will not be triggered.
There was a problem hiding this comment.
@rmch91 That's true, but the question that comes to mind is why would he do it in such a complicated way? If he extends the class, that forces him to have its own HTML structure (which will not be automatically updated from here). The fact that we cannot fix the behavior in his code - it's beyond our control if there is any customization, the question is only whether we are able to break something in his code/ui behavior this way?
There was a problem hiding this comment.
User can do it without any customization of the component. just register an event listener on cx-carousel in app.component and apply his own logic.
After this change it will not work. So seems that it is breaking
There was a problem hiding this comment.
I've made the fix opt-in via a preventNavigationFocus input flag (defaults to false), so it's only enabled in search-box and doesn't affect existing carousels or customer event listeners.
…afari searchbox blur issue
Co-authored-by: Cursor <cursoragent@cursor.com>
Merge Checks Failed |

Fix Safari searchbox carousel clicks closing results panel by preventing mousedown blur and moving next-slide logic into a reusable handler.