FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(select): Add the type prop to the select toggle button by boaz0 · Pull Request #3495 · patternfly/patternfly-react · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .snap  (1) .ts  (1) .tsx  (2) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
      • SelectToggle.tsx
        • Select.test.tsx.snap
        • select.spec.ts
        • SelectDemo.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ export class SelectToggle extends React.Component<SelectToggleProps> {
{children}
<button
{...toggleProps}
type={type}
className={css(buttonStyles.button, styles.selectToggleButton, styles.modifiers.plain)}
aria-label={ariaLabelToggle}
onClick={_event => {
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3525,6 +3525,7 @@ exports[`select custom select filter filters properly 1`] = `
aria-labelledby=" pf-toggle-id-6"
class="pf-c-button pf-c-select__toggle-button pf-m-plain"
id="pf-toggle-id-6"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -3622,6 +3623,7 @@ exports[`select custom select filter filters properly 1`] = `
disabled={false}
id="pf-toggle-id-6"
onClick={[Function]}
type="button"
>
<CaretDownIcon
className="pf-c-select__toggle-arrow"
Expand Down Expand Up @@ -6625,6 +6627,7 @@ exports[`typeahead multi select renders closed successfully 1`] = `
aria-labelledby=" pf-toggle-id-22"
class="pf-c-button pf-c-select__toggle-button pf-m-plain"
id="pf-toggle-id-22"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -6681,6 +6684,7 @@ exports[`typeahead multi select renders closed successfully 1`] = `
disabled={false}
id="pf-toggle-id-22"
onClick={[Function]}
type="button"
>
<CaretDownIcon
className="pf-c-select__toggle-arrow"
Expand Down Expand Up @@ -6884,6 +6888,7 @@ exports[`typeahead multi select renders expanded successfully 1`] = `
aria-labelledby=" pf-toggle-id-23"
class="pf-c-button pf-c-select__toggle-button pf-m-plain"
id="pf-toggle-id-23"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -6993,6 +6998,7 @@ exports[`typeahead multi select renders expanded successfully 1`] = `
disabled={false}
id="pf-toggle-id-23"
onClick={[Function]}
type="button"
>
<CaretDownIcon
className="pf-c-select__toggle-arrow"
Expand Down Expand Up @@ -7444,6 +7450,7 @@ exports[`typeahead multi select renders selected successfully 1`] = `
aria-labelledby=" pf-toggle-id-24"
class="pf-c-button pf-c-select__toggle-button pf-m-plain"
id="pf-toggle-id-24"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -7948,6 +7955,7 @@ exports[`typeahead multi select renders selected successfully 1`] = `
disabled={false}
id="pf-toggle-id-24"
onClick={[Function]}
type="button"
>
<CaretDownIcon
className="pf-c-select__toggle-arrow"
Expand Down Expand Up @@ -8362,6 +8370,7 @@ exports[`typeahead multi select test onChange 1`] = `
aria-labelledby=" pf-toggle-id-26"
class="pf-c-button pf-c-select__toggle-button pf-m-plain"
id="pf-toggle-id-26"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -8435,6 +8444,7 @@ exports[`typeahead multi select test onChange 1`] = `
disabled={false}
id="pf-toggle-id-26"
onClick={[Function]}
type="button"
>
<CaretDownIcon
className="pf-c-select__toggle-arrow"
Expand Down Expand Up @@ -8686,6 +8696,7 @@ exports[`typeahead select renders closed successfully 1`] = `
aria-labelledby=" pf-toggle-id-15"
class="pf-c-button pf-c-select__toggle-button pf-m-plain"
id="pf-toggle-id-15"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -8742,6 +8753,7 @@ exports[`typeahead select renders closed successfully 1`] = `
disabled={false}
id="pf-toggle-id-15"
onClick={[Function]}
type="button"
>
<CaretDownIcon
className="pf-c-select__toggle-arrow"
Expand Down Expand Up @@ -8944,6 +8956,7 @@ exports[`typeahead select renders expanded successfully 1`] = `
aria-labelledby=" pf-toggle-id-16"
class="pf-c-button pf-c-select__toggle-button pf-m-plain"
id="pf-toggle-id-16"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -9053,6 +9066,7 @@ exports[`typeahead select renders expanded successfully 1`] = `
disabled={false}
id="pf-toggle-id-16"
onClick={[Function]}
type="button"
>
<CaretDownIcon
className="pf-c-select__toggle-arrow"
Expand Down Expand Up @@ -9423,6 +9437,7 @@ exports[`typeahead select renders selected successfully 1`] = `
aria-labelledby=" pf-toggle-id-17"
class="pf-c-button pf-c-select__toggle-button pf-m-plain"
id="pf-toggle-id-17"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -9583,6 +9598,7 @@ exports[`typeahead select renders selected successfully 1`] = `
disabled={false}
id="pf-toggle-id-17"
onClick={[Function]}
type="button"
>
<CaretDownIcon
className="pf-c-select__toggle-arrow"
Expand Down Expand Up @@ -9960,6 +9976,7 @@ exports[`typeahead select test creatable option 1`] = `
aria-labelledby=" pf-toggle-id-21"
class="pf-c-button pf-c-select__toggle-button pf-m-plain"
id="pf-toggle-id-21"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -10036,6 +10053,7 @@ exports[`typeahead select test creatable option 1`] = `
disabled={false}
id="pf-toggle-id-21"
onClick={[Function]}
type="button"
>
<CaretDownIcon
className="pf-c-select__toggle-arrow"
Expand Down Expand Up @@ -10294,6 +10312,7 @@ exports[`typeahead select test onChange 1`] = `
aria-labelledby=" pf-toggle-id-19"
class="pf-c-button pf-c-select__toggle-button pf-m-plain"
id="pf-toggle-id-19"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -10367,6 +10386,7 @@ exports[`typeahead select test onChange 1`] = `
disabled={false}
id="pf-toggle-id-19"
onClick={[Function]}
type="button"
>
<CaretDownIcon
className="pf-c-select__toggle-arrow"
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,9 @@ describe('Select Test', () => {
cy.get('#check-select').click();
cy.get('.pf-c-select__menu').should('not.exist');
});

it('Verify Typeahead Select inside Form', () => {
cy.get('#form-typeahead-button').click();
cy.url().should('match', /select-demo-nav-link/)
});
});
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
Title,
SelectOptionObject,
Checkbox,
SelectDirection
SelectDirection,
Form
} from '@patternfly/react-core';
import React, { Component } from 'react';
import { CartArrowDownIcon } from '@patternfly/react-icons';
Expand Down Expand Up @@ -745,6 +746,36 @@ export class SelectDemo extends Component<SelectDemoState> {
);
}

renderTypeaheadSelectInForm() {
const { typeaheadOptions } = this.state;
const titleId = 'typeahead-select-form-id';
return (
<StackItem isFilled={false}>
<Title size="2xl">Typeahead inside a form</Title>
<Form onSubmit={(e) => { window.location.href="/404"; e.preventDefault() }}>
<span id={titleId} hidden>
Select a state
</span>
<Select
toggleId={'form-typeahead-button'}
variant={SelectVariant.typeahead}
aria-label="Select a state"
onToggle={() => null}
onSelect={() => null}
onClear={() => null}
selections={''}
isExpanded={false}
ariaLabelledBy={titleId}
placeholderText="Select a state"
>
<SelectOption value={'option1'} />
<SelectOption value={'option2'} />
</Select>
</Form>
</StackItem>
);
}

render() {
return (
<Stack gutter="md">
Expand All @@ -758,6 +789,7 @@ export class SelectDemo extends Component<SelectDemoState> {
{this.renderCustomTypeaheadMultiSelect()}
{this.renderPlainTypeaheadMultiSelect()}
{this.renderSelectCustomContent()}
{this.renderTypeaheadSelectInForm()}
</Stack>
);
}
Expand Down

Back | FazBrowse Home | New Git URL