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

broken? #615

Open
mizlan opened this issue May 31, 2023 · 8 comments
Open

broken? #615

mizlan opened this issue May 31, 2023 · 8 comments
Assignees

Comments

@mizlan
Copy link

mizlan commented May 31, 2023

I created a fresh new create-react-app project and tried to create an Allotment but I don't see any separator and nothing is draggable. Node version 18 and 20, React v18.2.0

@mizlan
Copy link
Author

mizlan commented May 31, 2023

I also get a version conflict with the recently merged dependabot changes with rollup:

npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/rollup
npm ERR!   dev rollup@"3.23.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer rollup@"^2.0.0" from [email protected]
npm ERR! node_modules/rollup-plugin-terser
npm ERR!   dev rollup-plugin-terser@"7.0.2" from the root project

@mizlan
Copy link
Author

mizlan commented May 31, 2023

The following React app also has the following error:

import React from 'react';
import { Allotment, setSashSize } from 'allotment'

const App = () => {
  return (
    <div style={{padding: '40px'}}>
      <Allotment vertical={true}>
        <Allotment.Pane maxSize={600}>
          <p>Lorem Ipsum</p>
        </Allotment.Pane>
        <Allotment.Pane maxSize={400}>
          <p>Lorem Ipsum</p>
        </Allotment.Pane>
      </Allotment>
    </div>
  );
}

export default App;
ERROR
ResizeObserver loop completed with undelivered notifications.
handleError@http://localhost:3000/static/js/bundle.js:39217:58
./node_modules/webpack-dev-server/client/overlay.js/createOverlay/<@http://localhost:3000/static/js/bundle.js:39236:18

It seems this error only occurs with attempting to set vertical

@mizlan
Copy link
Author

mizlan commented May 31, 2023

It seems like allotment's current behavior is to just render the panes vertically with no separator and no resizing capabilities; I am trying to inspect the source code and I think no CSS is being applied in my case... looking further into it.

@woodreamz
Copy link

woodreamz commented Jun 22, 2023

@mizlan I think you just forgot to read the Usage section :)

You just need to import the css

import 'allotment/dist/style.css';

@mizlan
Copy link
Author

mizlan commented Jun 22, 2023

You are right... I am embarrassed. Sorry, and thanks!

@mizlan
Copy link
Author

mizlan commented Jun 22, 2023

@woodreamz it is still not working even when importing the CSS

@johnwalley
Copy link
Owner

Hi @mizlan. I've tried to reproduce the problem with:

Node 20.3.1
npm 9.6.7
create-react-app 5.0.1
allotment 1.19.0
react 18.2.0

but with no success. Just one small thing to check. Are you giving your container element a height? I only ask because if it has height 0 then it often looks like the Allotment component isn't working.

Also, thanks for pointing out the rollup dependency conflict. I'll see if I can resolve it.

@johnwalley johnwalley self-assigned this Jun 27, 2023
@acherkashin
Copy link

I faced the same issue, however importing @import "allotment/dist/style.css"; fixed it.
I've tried to import it in:

  • App.less
  • App.tsx

It works in both situations.

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

No branches or pull requests

4 participants