flowbite icon indicating copy to clipboard operation
flowbite copied to clipboard

Fix dist/flowbite.js to not use arrow function

Open ioanacristinamarinescu opened this issue 3 years ago • 5 comments

Describe the bug On IE11 the dropdown does not work because of the use of arrow function.

To Reproduce Steps to reproduce the behavior:

  1. Go to IE11 https://flowbite.com/docs/components/dropdowns/
  2. Open web console
  3. See error

Expected behavior Dropdown list should appear

Screenshot Screenshot_2022-05-23_18-06-29

Desktop (please complete the following information):

  • OS: Windows
  • Browser IE11
  • Version 1.4.5

Additional context On my project I updated the first line in flowbite.js

/******/ (() => { // webpackBootstrap

with

/******/ (function() { // webpackBootstrap

ioanacristinamarinescu avatar May 23 '22 15:05 ioanacristinamarinescu

The main goal for this is to have IE11 support.

I am not sure if the source files have support for IE11 ... or if the projects even want to support IE11.

For webpack.config.js, a quick fix is to use:

module.exports = {
    target: ["web", "es5"]
}

adiroiban avatar May 24 '22 00:05 adiroiban

Hey @ioanacristinamarinescu @adiroiban,

I'll look into this for the next version. Thank you!

@adiroiban: you can open a PR if you want to and I'll take a look at it.

zoltanszogyenyi avatar May 26 '22 10:05 zoltanszogyenyi

Sure. I will create the PR.

adiroiban avatar May 26 '22 10:05 adiroiban

PR https://github.com/themesberg/flowbite/pull/163

Many thanks for this nice project :)

adiroiban avatar May 26 '22 10:05 adiroiban

I'll make this PR a candidate for the 1.5 version if our tests go through. Thanks!

zoltanszogyenyi avatar May 30 '22 13:05 zoltanszogyenyi

Hey peeps,

The arrow function is no longer used for the dist files as of v1.6.0.

Please check out this resource for confirmation:

https://unpkg.com/[email protected]/dist/flowbite.min.js

Cheers, Zoltan

zoltanszogyenyi avatar Jan 05 '23 14:01 zoltanszogyenyi