feat: Accessibility improvements (#7224)
* feat: adds a11y for ContentType & Responses region * feat: adds a11y to expandable/collapsible elements * fix: add aria label to select element for content types * fix: add aria label prop to contentType component * Change optag to h3 for better tag hierarchy Co-authored-by: ediiotero <eddie.otero@oddball.io> Co-authored-by: Mike Lumetta <mike.lumetta@adhocteam.us> Co-authored-by: Alexander Valencia <alex.valencia@adhocteam.us>
This commit is contained in:
10
src/helpers/create-html-ready-id.js
Normal file
10
src/helpers/create-html-ready-id.js
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Replace invalid characters from a string to create an html-ready ID
|
||||
*
|
||||
* @param {string} id A string that may contain invalid characters for the HTML ID attribute
|
||||
* @param {string} [replacement=_] The string to replace invalid characters with; "_" by default
|
||||
* @return {string} Information about the parameter schema
|
||||
*/
|
||||
export default function createHtmlReadyId(id, replacement = "_") {
|
||||
return id.replace(/[^\w-]/g, replacement)
|
||||
}
|
||||
Reference in New Issue
Block a user