themesberg / flowbite

Open-source UI component library and front-end development framework based on Tailwind CSS
https://flowbite.com
MIT License
7.55k stars 715 forks source link

passing in arguments to modal event handlers #644

Open anjanesh opened 1 year ago

anjanesh commented 1 year ago

using flowbite's modal using javascript

onclick="modal.show(546)"

  onShow: (index) => {
      console.log('modal is shown for index = ' + index);
  },

index is showing as [Object] which is the modal element.

https://gist.github.com/anjanesh/c77423bfc7cdc31f391ca81a76a11ac3

haenno commented 1 year ago

I don't think that the right argument is passed into the modal. It looks more like the whole modal is shown in the console. Including the onShow itself :-) Sorry. Good luck figuring this out.

image

RadekHavelka commented 10 months ago

@zoltanszogyenyi

it would be usefull to have some kind of reference in onShow() function to the object that is being shown. I stumbled upon this with TABS - how can I see which tab is being shown in its onShow() method?