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

feature(deleteSelectedElements): add deleteSelectedElements method #2432

Closed
wants to merge 1 commit into from

Conversation

pengfu
Copy link

@pengfu pengfu commented Sep 17, 2022

Thanks to the great job of react-flow, we can delete selected elements by pressing the deleteKeyCode , however, in some cases we may also want to delete them by clicking a delete button in the toolbar. This PR export deleteSelectedElements method in useReactFlow hook so that all people can use if they need.

@moklick
Copy link
Member

moklick commented Sep 20, 2022

Thanks for your contribution! Looks good to me, but could you do it against the v11 branch? Thanks!

@pengfu
Copy link
Author

pengfu commented Sep 21, 2022

Thanks for your contribution! Looks good to me, but could you do it against the v11 branch? Thanks!

okay, I am about to close this PR and will do it against the v11 branch in another PR. Many thanks!!

@pengfu pengfu closed this Sep 21, 2022
@pengfu
Copy link
Author

pengfu commented Sep 22, 2022

@moklick hey mocklick , when I checkout out to branch v11 on my Mac , pnpm install is OK, but then when I tried pnpm dev , the browser open and shows error as follows,
[plugin:vite:import-analysis] Failed to resolve entry for package "reactflow". The package may have incorrect main/module/exports specified in its package.json.
/Users/pengfu/Documents/Github/react-flow/examples/vite-app/src/examples/EdgeRouting/index.tsx at packageEntryFailure (file:///Users/pengfu/Documents/Github/react-flow/node_modules/.pnpm/registry.npmjs.org+vite@3.1.0/node_modules/vite/dist/node/chunks/dep-665b0112.js:34766:11) at resolvePackageEntry (file:///Users/pengfu/Documents/Github/react-flow/node_modules/.pnpm/registry.npmjs.org+vite@3.1.0/node_modules/vite/dist/node/chunks/dep-665b0112.js:34763:5) at tryNodeResolve (file:///Users/pengfu/Documents/Github/react-flow/node_modules/.pnpm/registry.npmjs.org+vite@3.1.0/node_modules/vite/dist/node/chunks/dep-665b0112.js:34513:20) at Context.resolveId (file:///Users/pengfu/Documents/Github/react-flow/node_modules/.pnpm/registry.npmjs.org+vite@3.1.0/node_modules/vite/dist/node/chunks/dep-665b0112.js:34286:28) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.resolveId (file:///Users/pengfu/Documents/Github/react-flow/node_modules/.pnpm/registry.npmjs.org+vite@3.1.0/node_modules/vite/dist/node/chunks/dep-665b0112.js:40959:32) at async TransformContext.resolve (file:///Users/pengfu/Documents/Github/react-flow/node_modules/.pnpm/registry.npmjs.org+vite@3.1.0/node_modules/vite/dist/node/chunks/dep-665b0112.js:40728:23) at async normalizeUrl (file:///Users/pengfu/Documents/Github/react-flow/node_modules/.pnpm/registry.npmjs.org+vite@3.1.0/node_modules/vite/dist/node/chunks/dep-665b0112.js:37508:34) at async TransformContext.transform (file:///Users/pengfu/Documents/Github/react-flow/node_modules/.pnpm/registry.npmjs.org+vite@3.1.0/node_modules/vite/dist/node/chunks/dep-665b0112.js:37648:47) at async Object.transform (file:///Users/pengfu/Documents/Github/react-flow/node_modules/.pnpm/registry

I am troubled why this happen on my side. Sorry to trouble you but look forward to your help. Thanks!!

@moklick
Copy link
Member

moklick commented Sep 22, 2022

did you try to do rm -rf node_modules ?

@pengfu
Copy link
Author

pengfu commented Sep 22, 2022

did you try to do rm -rf node_modules ?

yes, I did these steps,
1, I remove the whole project , then clone a new, and checkout to branch v11, so there is no node_modules first
2, I delete the cache of pnpm by using pnpm store prune
3, pnpm install, it seems all is well
4, pnpm dev ,it appear error on the vscode console reactflow:dev: [0] 1 export * from '@reactflow/core'; reactflow:dev: [0] ~~~~~~~~~~~~~~~~~ reactflow:dev: [0] src/index.ts:2:15 - error TS2307: Cannot find module '@reactflow/minimap' or its corresponding type declarations. reactflow:dev: [0] reactflow:dev: [0] 2 export * from '@reactflow/minimap'; reactflow:dev: [0] ~~~~~~~~~~~~~~~~~~~~ reactflow:dev: [0] src/index.ts:3:15 - error TS2307: Cannot find module '@reactflow/controls' or its corresponding type declarations. reactflow:dev: [0] reactflow:dev: [0] 3 export * from '@reactflow/controls';
also, the browser appear [plugin:vite:import-analysis] Failed to resolve import "reactflow/dist/style.css" from "src/main.tsx". Does the file exist?

It seems that the pnpm workspace don't work well on my Mac ?

@pengfu
Copy link
Author

pengfu commented Sep 30, 2022

When later I re-pull the latest codes of the repo , the issues above disappeared .

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.

None yet

3 participants