Advanced Sortable Drag and Drop with React & TailwindCSS

แชร์
ฝัง

ความคิดเห็น • 66

  • @tomisloading
    @tomisloading  10 หลายเดือนก่อน +5

    !!QUICK NOTE!!
    If anyone is having issues on mobile, try adding ontouch events along with your ondrag events! According to caniuse, the drag API SHOULD be supported on all modern browser's, but after a bit of googling it looks like some devices won't listen for drag. Touch events should work though!
    I've been unable to replicate as this works as expected on all devices I have access to, so if this solution works for anyone, please let me know so that I can update the source code 😂😂

  • @FlintBits
    @FlintBits 10 หลายเดือนก่อน +46

    For any juniors - pay attention to his mental approach when going through this exercise. The order, code layout, how functions are introduced, is the most valuable thing in this video.

  • @EnriqueDominguezProfile
    @EnriqueDominguezProfile 10 หลายเดือนก่อน +8

    This is simply brilliant. The way you used data-attributes, and storing the ID on the event itself! I learnt a ton from this tutorial. Thank you very much.

    • @tomisloading
      @tomisloading  10 หลายเดือนก่อน +1

      Thank you so much! :)

  • @bryancastillo52
    @bryancastillo52 19 วันที่ผ่านมา +1

    The way you provide each part of the components, drag events and the use custom html attributes (data-attributes) is awesome! Your approach to implement this feature is awesome and I learned a lot. Thanks for sharing this. Keep it up! 😊💫💫

  • @karthikraju6225
    @karthikraju6225 9 หลายเดือนก่อน +9

    You should change the channel name to Tom Is Cooking. Thank you for making this!

    • @tomisloading
      @tomisloading  9 หลายเดือนก่อน +2

      😂😂😂

  • @Dom-zy1qy
    @Dom-zy1qy 10 หลายเดือนก่อน +4

    For things like this, it might be better to use react context to provide the methods for setting cards and reading cards associated with each column.
    It does couple your components to context though, but I'd imagine its a lot more efficient. If you store a hashmap in the context, using column IDs as keys, and storing the associated cards in an array, you'd be able to instantly look up all card associated with that column. Instead of doing linear search on all cards for every column.
    That method would require a bit of boilerplate and probably not the best content, maybe even overkill for a non performance intensive app like a todolist.

    • @iukys3889
      @iukys3889 10 หลายเดือนก่อน

      I agree, react context feels better here

  • @justhrthings
    @justhrthings 10 หลายเดือนก่อน +3

    this is awesome really appreciated for these tutorials looking forward for more.

  • @alvaroaquije2572
    @alvaroaquije2572 10 หลายเดือนก่อน +5

    Damn this is gold here guys!

  • @ruturajreddy1
    @ruturajreddy1 10 หลายเดือนก่อน +3

    Tom is loading ❌ legend ✅. Thanks for this absolutely simple explanation.

  • @zinter716
    @zinter716 10 หลายเดือนก่อน +7

    This tutorial is worth moneyy

    • @tomisloading
      @tomisloading  10 หลายเดือนก่อน

      Thank you!! Took a while longer than most of my videos, hoping people find it more useful 😂

  • @danielasofiavargasmahecha4781
    @danielasofiavargasmahecha4781 หลายเดือนก่อน +1

    Amazing!

  • @iuliancarnaru954
    @iuliancarnaru954 10 หลายเดือนก่อน +2

    Great content, keep the good work up

  • @comfy6355
    @comfy6355 5 หลายเดือนก่อน +1

    this was really easy to understand and follow along video! But I'm having a hard time understanding how your handleDragEndFunction knows what column the card is being dropped into if you never passed it?

  • @ismael3s
    @ismael3s 10 หลายเดือนก่อน +1

    Dude, you're amazing

  • @ifindev
    @ifindev 10 หลายเดือนก่อน +1

    Awesome!!!

  • @FreeCodeArena
    @FreeCodeArena 10 หลายเดือนก่อน +1

    Awesome content 🎉

  • @Cypekeh
    @Cypekeh 9 หลายเดือนก่อน

    2:33, how can you accept ${headingColor} prop as a Tailwind class?
    Shouldn't tailwind classes be typed out explicitly for them to properly compile?

    • @tomisloading
      @tomisloading  9 หลายเดือนก่อน +1

      They’re typed out explicitly higher up in the file, you are correct in a sense though, if you tried to do something like ‘text-${color}-500’ it would not work

    • @Cypekeh
      @Cypekeh 9 หลายเดือนก่อน +1

      @@tomisloading Thanks for a quick reply

  • @DanteMishima
    @DanteMishima 8 หลายเดือนก่อน +1

    No shadcn - Here take your like

  • @DanZ-fq2qs
    @DanZ-fq2qs 6 หลายเดือนก่อน +1

    I like how you present the building process by not typing everything, this vid will easily become a 5 hours course in some other channel. Thank you for saving our time.

  • @freakinmonkey85
    @freakinmonkey85 10 หลายเดือนก่อน +4

    The result is solid but it gives me ticks that you instantiate variables descending order. E.g. when you start building the kanban and you have “Board” and “Column” AFTER the Kanban, but still use them inside. That should be illegal 😅

    • @tomisloading
      @tomisloading  10 หลายเดือนก่อน

      LOL well I mean I’d generally have them in their own files, just easier to do it in one for a video 😂😂

  • @DavidConnerCodeaholic
    @DavidConnerCodeaholic 10 หลายเดือนก่อน

    Your code is readable and I can follow the video very well.
    I haven’t done much with React, but all those functions returning JSX returning functions make me a bit nervous … about React. Does code like this GC alright?
    Typescript’s type system would help React out quite a bit.

    • @tomisloading
      @tomisloading  10 หลายเดือนก่อน

      One thing I’ll note is that I would generally never have all of these functions in the same file, it’s just easier to follow (and record) in a video.
      TypeScript ABSOLUTELY helps, I never work without it, but I recognize some haven’t learned it yet so I generally make videos without it just so it’s easier for beginners to follow

  • @komal871
    @komal871 9 วันที่ผ่านมา

    y does the opacity of the div decreases when i am dragging it

  • @vaibhavchauhan3741
    @vaibhavchauhan3741 10 หลายเดือนก่อน +1

    css is not loading so what should i do,also i have npm install react framer-motion react-icons in my react app please help!!

  • @duoctran9069
    @duoctran9069 10 หลายเดือนก่อน

    I wish I had known about this sooner

  • @redcastle1745
    @redcastle1745 9 หลายเดือนก่อน

    Why didn't you use framer motion reorder?

    • @tomisloading
      @tomisloading  9 หลายเดือนก่อน +1

      I find it to be a bit buggy

    • @redcastle1745
      @redcastle1745 9 หลายเดือนก่อน

      @@tomisloading thank you for reply, I always learn from your work

  • @godofwar8262
    @godofwar8262 10 หลายเดือนก่อน +2

    Bro please make a video on your website how you create it and can we create it using on react

  • @Muhammed-nani964
    @Muhammed-nani964 10 หลายเดือนก่อน +1

    Noice bro keep it up

  • @yassine-sa
    @yassine-sa 10 หลายเดือนก่อน

    It would be really helpful if you make another video about improving the accessibility of this, or at least show how migrating it to something like shadcn would improve accessibility I suppose

  • @CowMeCow
    @CowMeCow 7 หลายเดือนก่อน

    is there ways to impliment your components in WordPress?

  • @NoelVega-u3l
    @NoelVega-u3l หลายเดือนก่อน

    Drag leave is triggered on the column when dragging cards over child elements of the column... anyone else experiencing this? Its causing the column background color to flicker when hover over other cards.

  • @Solo_playz
    @Solo_playz 10 หลายเดือนก่อน +1

    That is the next project in my queue and after that in my resume also you are just amazing bro what an easy tutorial you have created for such an advanced project(KANBAN BOARD) 🔥🔥
    Also please let me know which VSCode theme you are using that looks very cool!

    • @tomisloading
      @tomisloading  10 หลายเดือนก่อน +1

      Thank you!! Happy to help! :) and my theme is called Andromeda 😁

    • @Solo_playz
      @Solo_playz 10 หลายเดือนก่อน

      @@tomisloading Thank you

  • @PrinceKumarDhankhar-oc1gf
    @PrinceKumarDhankhar-oc1gf 6 หลายเดือนก่อน

    There is one bug.
    How to reproduce?
    1. Add a new card.
    2. Again Add a new card without typing anything. It will take title from older state. As you forgot to clear the state on submit.

    • @tomisloading
      @tomisloading  6 หลายเดือนก่อน

      Good callout!

  • @estebanmutis2386
    @estebanmutis2386 10 หลายเดือนก่อน +1

    Thank u!!

    • @tomisloading
      @tomisloading  10 หลายเดือนก่อน

      Happy to help!

  • @megamind452
    @megamind452 10 หลายเดือนก่อน +1

    Would this also work on touch devices? As far I know you can't pass data using dataTransfer on touch devices. Please let me know if it is possible. Nice vid 👍

    • @tomisloading
      @tomisloading  10 หลายเดือนก่อน

      Yes, it should work the same! Possible there’s edge cases I’m unaware of but I can say that the demo in this video works as expected :)

    • @megamind452
      @megamind452 10 หลายเดือนก่อน

      @@tomisloading it's not working, I tried on your website using my phone. Is there any way to make it work.would really appreciate that.

    • @tomisloading
      @tomisloading  10 หลายเดือนก่อน

      @@megamind452 Hmm, try adding onTouch events as well as the onDrag events (named similarly, so onTouchStart etc). I was under the impression you didn't need to do this, but Googling around a bit, looks like that could be an issue for some devices.
      If not, I'd try googling for issues with whatever browser you're using. caniuse shows support for pretty much every modern browser outside of firefox for android heh.

  • @guptaashwanee
    @guptaashwanee 10 หลายเดือนก่อน

    It is a nice and clear tutorial, could you please help me to create a nesting drag and drop, where items may have sub items and subitems can be drag and drop inside an item along with it's parent

  • @SanthoshKumar-dev
    @SanthoshKumar-dev 10 หลายเดือนก่อน

    Any tutorials on Gsap ?

    • @tomisloading
      @tomisloading  10 หลายเดือนก่อน

      Haven’t done any yet, but definitely will in the future!

  • @sahilverma_dev
    @sahilverma_dev 10 หลายเดือนก่อน +1

    Great

  • @beodan9219
    @beodan9219 10 หลายเดือนก่อน

    wow

  • @sumonchandra5992
    @sumonchandra5992 10 หลายเดือนก่อน +4

    OMG!!!!! That's amazing 🤩

    • @tomisloading
      @tomisloading  10 หลายเดือนก่อน

      Thank you!! 😁

  • @aghileslounis
    @aghileslounis 10 หลายเดือนก่อน +1

    Your components are incredible I checked your website, and it's generous with a lot of free components! So talented!
    Design and being creative is my biggest issue as software engineer, like when I see a design or an animation I can replicate it without looking at the code most of the time (not all of them, you have some intriguing and difficult animations) but come up with the design or animation it's nearly impossible I find that task so difficult 😅

    • @tomisloading
      @tomisloading  10 หลายเดือนก่อน

      Thank you for the kind words!! 🙂

  • @ndivij
    @ndivij 10 หลายเดือนก่อน

    This is not working well for phone devices its going out of the page 😊 do have a look at it thanks for the tutorial

  • @xczm225
    @xczm225 10 หลายเดือนก่อน +1

    im so far from it, even tho coding for two years...

  • @Lifad2562
    @Lifad2562 6 หลายเดือนก่อน +1

    Awesome !