Skip to content

Conversation

@fallmo
Copy link

@fallmo fallmo commented Nov 22, 2025

Update ref types to HTMLSpanElement and initialize with null to fix TS errors

All Drawer examples use a <span> as the focusable element in DrawerHead, but the refs were typed as HTMLDivElement. This caused TypeScript errors and didn’t match the actual DOM element.

This PR fixes typescript errors by:

  • Updating the ref type to HTMLSpanElement to match element.
  • Initializing the refs with null since HTMLSpanElement | undefined is not assignable to HTMLSpanElement | null

Here is a screenshot of before:
Screenshot 2025-11-21 at 11 53 57 PM

Update ref types to HTMLSpanElement and initialize with null to fix TS errors

Signed-off-by: Mohamed Fall <ps.hackmaster@gmail.com>
@patternfly-build
Copy link
Collaborator

patternfly-build commented Nov 22, 2025

@fallmo
Copy link
Author

fallmo commented Nov 22, 2025

Hey @kmcfaul @thatblindgeye, please check this out. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants