Skip to content

Commit

Permalink
fix: fix issue with safari 12
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson committed Dec 17, 2023
1 parent ed57e94 commit 0efcfc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/picker/components/Picker/Picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ export function createRoot (target, props) {
calculateEmojiGridStyle
}

let firstRender = true
createEffect(() => {
render(target, state, helpers, events, actions, refs, abortSignal)
render(target, state, helpers, events, actions, refs, abortSignal, firstRender)
firstRender = false
})

//
Expand Down
4 changes: 2 additions & 2 deletions src/picker/components/Picker/PickerTemplate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createFramework } from './framework.js'

export function render (container, state, helpers, events, actions, refs, abortSignal) {
export function render (container, state, helpers, events, actions, refs, abortSignal, firstRender) {
const { labelWithSkin, titleForEmoji, unicodeWithSkin } = helpers
const { html, map } = createFramework(state)

Expand Down Expand Up @@ -221,7 +221,7 @@ export function render (container, state, helpers, events, actions, refs, abortS

const rootDom = section()

if (rootDom.parentNode !== container) { // not a re-render
if (firstRender) { // not a re-render
container.appendChild(rootDom)

// we only bind events/refs/actions once - there is no need to find them again given this component structure
Expand Down

0 comments on commit 0efcfc4

Please sign in to comment.