Skip to content

Conversation

@nicolethoen
Copy link
Contributor

@nicolethoen nicolethoen commented Jan 9, 2023

What: Closes #8402

deprecates the titleHeadingLevel
adds a component prop
updates existing examples on the Alert page to avoid new console warnings and advise the use of the component prop.

Created new issue to track the removal of the deprecated titleHeadingLevel prop: #8519

@patternfly-build
Copy link
Contributor

patternfly-build commented Jan 9, 2023

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were also a few GH lint warnings (similar to my Accordion PR).


* As demonstrated in the 5th and 6th variations below, use the `titleHeadingLevel` property to set the heading level of an alert title. Headings should be ordered by their level and heading levels should not be skipped. For example, a heading of an `h2` level should not be followed directly by an `h4`.
* As demonstrated in the 5th and 6th variations below, use the `component` property to set the element for an alert title.
* If there is no description below the alert title, then the `component` prop could be set to a non-heading element such as a `span` or `div`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, just to make it more of a recommendation:

Suggested change
* If there is no description below the alert title, then the `component` prop could be set to a non-heading element such as a `span` or `div`.
* If the `description` prop is not passed in, then the `component` prop should be set to a non-heading element such as a `span` or `div`.

We should also open up a followup issue for org to update the a11y docs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolethoen
Copy link
Contributor Author

There were also a few GH lint warnings (similar to my Accordion PR).

ah yeah - those are old, but I can take a look at seeing about cleaning it up

React.useEffect(() => {
dismissed && onTimeout();
}, [dismissed]);
}, [dismissed, timeoutAnimation]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this was added to the wrong useEffect. onTimeout could be added here to dismiss the GH warning and timeoutAnimation added to the useEffect above this one.

Comment on lines 159 to 164
const calculatedTimeout = timeout === true ? 8000 : Number(timeout);
if (calculatedTimeout > 0) {
const timer = setTimeout(() => setTimedOut(true), calculatedTimeout);
return () => clearTimeout(timer);
}
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GH is still warning about missing timeout in the dependency array here

Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tlabaj
Copy link
Contributor

tlabaj commented Jan 20, 2023

Just needs a rebase and we can merge.

@nicolethoen nicolethoen force-pushed the alert_custom_component branch from 942f8ec to fa4ba73 Compare January 23, 2023 18:05
@tlabaj tlabaj merged commit fe4a894 into patternfly:main Jan 24, 2023
@patternfly-build
Copy link
Contributor

Your changes have been released in:

  • @patternfly/react-code-editor@4.82.112
  • @patternfly/react-core@4.276.5
  • @patternfly/react-docs@5.103.61
  • @patternfly/react-inline-edit-extension@4.86.117
  • demo-app-ts@4.210.6
  • @patternfly/react-table@4.112.38
  • @patternfly/react-topology@4.91.26
  • @patternfly/react-virtualized-extension@4.88.112

Thanks for your contribution! 🎉

@nicolethoen nicolethoen deleted the alert_custom_component branch February 8, 2023 13:54
@nicolethoen nicolethoen restored the alert_custom_component branch February 8, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug - Alert - forcing text to be a heading is causing accessibility issues

6 participants