akiran / akiran/react-slick

Arrows elements are polluted

未關閉
#2,051 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
11.9k
分支
2.1k
PR 合併指標
30 天內沒有已合併 PR

描述

### Problem
When using arrows (`arrows: true`), elements used in `nextArrow` and `prevArrow` are polluted. Their `className` is changed entirely. Used Chrome DevTools to check the class list.

### Expected behaviour
Either:
a) embed the passed element in some `div` or
b) make the library append required classes (`slick-arrow`, `slick-next`) instead overwriting whole class list (the same would be with other fields possibly(?)).
c) add `nextArrowClassName`/`rightArrowClassName` (but its stupid tbh)

### Example code
https://codesandbox.io/s/react-slick-playground-forked-lew3o?file=/index.js
The example code includes part of https://react-slick.neostack.com/docs/example/custom-arrows .

### Workaround
Embed the passed element in dummy `div`. By the way, React `Fragment` won't do ('<>`).

_Tags: `[Not critical]`, `[Quality of Life]`_

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。