lucprincen / gutenberg-sortable Goto Github PK
View Code? Open in Web Editor NEWGutenberg component to sort items in a block
License: MIT License
Gutenberg component to sort items in a block
License: MIT License
This issue is probably caused by a babel-setting somewhere saying
The code in edit() looks like this:
<Sortable items={ sortContent } axis="grid" onSortEnd={ ( c ) => console.log( c ) }> { sortContent.map( ( c, idx ) => ( <div key={ idx }>{ c.count }</div> ) ) } </Sortable>
Full function can be found here:
https://gist.github.com/mauryaratan/2f5ec91db6b46db299008d76ec19fdfb
Reported by @mauryaratan
Enable script debug in Wordpress 5.9.3 or newer:
define( 'SCRIPT_DEBUG', true );
Add gutenberg-sortable as component in your Gutenberg custom-block like:
import Sortable from 'gutenberg-sortable';
Results in following warning in JS-console:
Warning: Legacy context API has been detected within a strict-mode tree.
The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.
Please update the following components: sortableList
Only solution actual: do not set SCRIPT_DEBUG to true.
I think this component needs an update to match the new react-api?
This problem occurs when using Gutenberg PlainText component inside any sortable item it's almost the same issue with this one #120
Currently Sortable always renders as a <div>
, but this needs to be variable so we're actually encouraging the use of semantic HTML
Add a check to see if there are children to display? Otherwise; display nothing and don't run any logic.
Reported by @mauryaratan
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.