Skip to content

Commit

Permalink
chore: removes replaceHydrationFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
langz committed Sep 21, 2023
1 parent 6c70c63 commit c369e77
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 44 deletions.
10 changes: 0 additions & 10 deletions packages/dnb-design-system-portal/gatsby-browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import { applyPageFocus } from '@dnb/eufemia/src/shared/helpers'
import { rootElement, pageElement } from './src/core/PortalProviders'
import ReactDOM from 'react-dom/client'

if (typeof window !== 'undefined') {
setIsTest(window.location)
Expand All @@ -18,15 +17,6 @@ function setIsTest(location) {
}
}

export const replaceHydrateFunction = () => {
// Added to solve the following errors, which prevented us from running screenshot tests
// https://github.com/gatsbyjs/gatsby/discussions/36232
return (element: React.ReactElement, container: HTMLElement) => {
const root = ReactDOM.createRoot(container)
root.render(element)
}
}

export const wrapRootElement = rootElement('browser')
export const wrapPageElement = pageElement()

Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-design-system-portal/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ module.exports = {
PRESERVE_FILE_DOWNLOAD_CACHE: true,
PARALLEL_SOURCING: true,
FAST_DEV: true,
DEV_SSR: false,
DEV_SSR: true,
},
pathPrefix,
siteMetadata,
Expand Down
34 changes: 2 additions & 32 deletions packages/dnb-eufemia/src/components/autocomplete/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
getPreviousSibling,
} from '../../shared/component-helper'
import {
IS_MAC,
IS_WIN,
IS_EDGE,
debounce,
Expand All @@ -41,9 +40,7 @@ import FormStatus from '../form-status/FormStatus'
import IconPrimary from '../icon-primary/IconPrimary'
import Input, { SubmitButton } from '../input/Input'
import ProgressIndicator from '../progress-indicator/ProgressIndicator'
import DrawerList, {
ItemContent,
} from '../../fragments/drawer-list/DrawerList'
import DrawerList from '../../fragments/drawer-list/DrawerList'
import DrawerListContext from '../../fragments/drawer-list/DrawerListContext'
import DrawerListProvider from '../../fragments/drawer-list/DrawerListProvider'
import {
Expand Down Expand Up @@ -1631,30 +1628,6 @@ class AutocompleteInstance extends React.PureComponent {
}
}

getVoiceOverActiveItem(selected_sr) {
// Add VoiceOver support to read the "selected" item
if (IS_MAC) {
const { active_item, selected_item } = this.context.drawerList
const currentDataItem = getCurrentData(
active_item,
this.context.drawerList.data
)

return (
<span className="dnb-sr-only" aria-live="assertive" aria-atomic>
{currentDataItem && (
<>
{active_item === selected_item ? <>{selected_sr} </> : null}
<ItemContent>{currentDataItem}</ItemContent>
</>
)}
</span>
)
}

return null
}

render() {
// use only the props from context, who are available here anyway
const props = (this._props = extendPropsWithContextInClassComponent(
Expand Down Expand Up @@ -1702,7 +1675,7 @@ class AutocompleteInstance extends React.PureComponent {
search_numbers, // eslint-disable-line
search_in_word_index, // eslint-disable-line
show_options_sr, // eslint-disable-line
selected_sr,
selected_sr, // eslint-disable-line
submit_button_title,
submit_button_icon,
portal_class,
Expand Down Expand Up @@ -2030,9 +2003,6 @@ class AutocompleteInstance extends React.PureComponent {
</span>
</span>

{/* Add VoiceOver support to read the "selected" item */}
{this.getVoiceOverActiveItem(selected_sr)}

<span className="dnb-sr-only" aria-live="assertive">
{ariaLiveUpdate}
</span>
Expand Down
4 changes: 3 additions & 1 deletion packages/dnb-eufemia/src/shared/Theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ export default function Theme(themeProps: ThemeAllProps) {
...restProps
} = themeProps

const themeName = 'ui' as ThemeNames

const theme = extendPropsWithContext(
{
name,
name: themeName,
variant,
size,
propMapping,
Expand Down

0 comments on commit c369e77

Please sign in to comment.