Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Tipseen nests a div inside of a p tag #1988

Open
ahlivehr opened this issue Mar 1, 2024 · 10 comments
Open

[Bug]: Tipseen nests a div inside of a p tag #1988

ahlivehr opened this issue Mar 1, 2024 · 10 comments
Labels
bug Something isn't working contribution welcome

Comments

@ahlivehr
Copy link

ahlivehr commented Mar 1, 2024

Vibe version

2.93.0

Describe the bug

Getting the following warning in the Chrome console when using a Tipseen.
Warning: validateDOMNesting(...):

cannot appear as a descendant of

.

When inspecting the DOM in the Storybook basic example, you can see it does indeed nest a div inside a p tag (see screenshot). Though in Storybook, I don't see the same warning in the Chrome console.

Expected behavior

Tipseen doesn't nest a div inside of a p tag.

Steps to reproduce

  1. Add a Tipseen to a react project (I'm using vite) and run the project
<Tipseen
  content={<TipseenContent title="Title">Popover message will appear here loremipsum dolor samet…</TipseenContent>}
  modifiers={[
    {
      name: 'preventOverflow',
      options: {
        mainAxis: false
      }
    },
    {
      name: 'flip',
      options: {
        fallbackPlacements: []
      }
    }
  ]}
  position="right"
>
  <div className="monday-storybook-tipseen_container" />
</Tipseen>
  1. Open the Chrome console and you can see the warning: Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>.

Reproduction example link

No response

System Info

System:
    OS: macOS 14.3.1
    CPU: (14) arm64 Apple M3 Max
    Memory: 141.75 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.6.1 - /opt/homebrew/bin/node
    Yarn: 1.22.21 - /usr/local/bin/yarn
    npm: 10.2.4 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 122.0.6261.94
    Safari: 17.3.1

Additional context, Screenshots

image

@ahlivehr ahlivehr added the bug Something isn't working label Mar 1, 2024
@ahlivehr
Copy link
Author

ahlivehr commented Mar 1, 2024

The specific place in the source code where the issue comes from is:
https://github.com/mondaycom/monday-ui-react-core/blob/c057a2e83d2d3fb62c05e29ab768f44a77045fe9/packages/core/src/components/Tipseen/Tipseen.tsx#L146

Notice how the element is "p", but if you put a TipseenContent element inside of it, there will be a div inside of a p tag.

@HermanBide
Copy link

has this been fixed ?

@ahlivehr
Copy link
Author

ahlivehr commented Mar 2, 2024

@HermanBide I don't think it has. I just filed this bug yesterday.

@HermanBide
Copy link

can i contribute to fixing this bug ?

@shaharzil
Copy link
Contributor

Hi @ahlivehr and thank you for bringing this bug to our attention :)

Thank you @HermanBide , We would appreciate it if you could contribute to fixing the problem. I'll just mention that since the fix may be a breaking change, we may not be able to merge it right now and can only include it in our next major version

@ahlivehr
Copy link
Author

ahlivehr commented Mar 3, 2024

@shaharzil No problem! Do you happen to know roughly when the next major version will be released? I really appreciate everyone's continuous contributions to this repo.

@HermanBide
Copy link

awesome please assign this to me ill work on it asap

HermanBide pushed a commit to HermanBide/monday-ui-react-core that referenced this issue Mar 4, 2024
@HermanBide
Copy link

the bug error doesnt show in the console anymore. here is what i did ->
I removed the div inside Tipseen since a 'p' element could not nest a 'div' and instead placed the Tipseen inside the div in component "tipseen.stories.js" which stopped the error.

   <div className="monday-storybook-tipseen_container">
          <Tipseen
            modifiers={modifiers}
            position={Tipseen.positions.RIGHT}
            content={
              <TipseenContent title="This is a title" hideDismiss>
                Popover message will appear here loremipsum dolor samet…
              </TipseenContent>
            }
          />
        </div>

please try this instead and let me know if you are still getting the same error. also there seem to be a bug about id in Tipseen.tsx

@HermanBide
Copy link

let me know if you also need help with the other bug

react-jsx-runtime.development.js:124 Warning: Invalid prop id supplied to React.Fragment. React.Fragment can only have key and children props.

@HermanBide
Copy link

what component ->folder/file is this code in so that i can fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working contribution welcome
Projects
None yet
Development

No branches or pull requests

4 participants