Skip to content
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

Masthead Search click event enhancement #4599

Closed
kyjak opened this issue Dec 1, 2020 · 4 comments
Closed

Masthead Search click event enhancement #4599

kyjak opened this issue Dec 1, 2020 · 4 comments
Assignees
Labels
adopter: Docs/KC used when component or pattern will be used by this adopter adopter support Feature request A new adopter requested feature package: react Work necessary for the Carbon for IBM.com react components package priority: medium Sprint Must Have
Milestone

Comments

@kyjak
Copy link

kyjak commented Dec 1, 2020

Currently the event fired when user activates the search from masthead is an info event only.
We need a way to prevent the default action to happen, something like normal events have
e.stopPropagation or e.preventDefault
or simply if the event hook function returns True, it would mean the search was handled and
dotcom would not go to the default ibm.com search.

@kyjak kyjak added the Feature request A new adopter requested feature label Dec 1, 2020
@kyjak
Copy link
Author

kyjak commented Dec 7, 2020

Adding just to be sure, the same interception should be applied to the keyboard (hitting ENTER) an any other possible submit event that launches the search.

@RobertaJHahn RobertaJHahn added adopter support adopter: Docs/KC used when component or pattern will be used by this adopter labels Dec 8, 2020
@RobertaJHahn
Copy link

The KC team is OK with scheduling in the Jan 2021 release

@RobertaJHahn
Copy link

Functional spec updates are needed.

@RobertaJHahn RobertaJHahn added the package: react Work necessary for the Carbon for IBM.com react components package label Dec 8, 2020
@RobertaJHahn RobertaJHahn added this to the Sprint 20-25 milestone Dec 8, 2020
@ljcarot
Copy link
Member

ljcarot commented Dec 9, 2020

Feb 15 is their launch date

kodiakhq bot pushed a commit that referenced this issue Jan 15, 2021
### Related Ticket(s)

#4599 

### Description

This adds an optional `searchNoRedirect` prop to the `Masthead` component. When used, the masthead search will no longer redirect to the default search results page. Autosuggest items will still populate, but clicking them will not trigger a redirect. Any redirect actions must be provided in the `onSearchNoRedirect` custom event.

### Changelog

**New**

- `searchNoRedirect` prop to `Masthead`
- `onSearchNoRedirect` custom event. Emits when `searchNoRedirect` is true

**Changed**

- clean up `MastheadSearch` props

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "package: styles": Carbon Expressive -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
IgnacioBecerra pushed a commit to IgnacioBecerra/ibm-dotcom-library that referenced this issue Feb 22, 2021
### Related Ticket(s)

carbon-design-system#4599 

### Description

This adds an optional `searchNoRedirect` prop to the `Masthead` component. When used, the masthead search will no longer redirect to the default search results page. Autosuggest items will still populate, but clicking them will not trigger a redirect. Any redirect actions must be provided in the `onSearchNoRedirect` custom event.

### Changelog

**New**

- `searchNoRedirect` prop to `Masthead`
- `onSearchNoRedirect` custom event. Emits when `searchNoRedirect` is true

**Changed**

- clean up `MastheadSearch` props

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "package: styles": Carbon Expressive -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adopter: Docs/KC used when component or pattern will be used by this adopter adopter support Feature request A new adopter requested feature package: react Work necessary for the Carbon for IBM.com react components package priority: medium Sprint Must Have
Projects
None yet
Development

No branches or pull requests

8 participants