APlayer icon indicating copy to clipboard operation
APlayer copied to clipboard

listMaxHeight does not work and no scroll in Fixed mode

Open yansheng836 opened this issue 5 years ago • 4 comments

The listMaxHeight does not work and no scroll in Fixed mode. This problem also like : https://github.com/MoePlayer/APlayer/issues/277#issue-456161855

config:

<script>
              const ap = new APlayer({
                container: document.getElementById('aplayer'),
                fixed: true,
                autoplay: false,
                theme: '#b7daff',
                loop: 'all',
                order: 'list',
                preload: 'auto',
                volume: 0.5,
                lrcType: 3,
                mutex: true,
                listFolded: false,
                listMaxHeight: 30,

pic: image

I don't know if it doesn't work in this mode, or if my other styles affect it.

I use Aplayer in my blog using hexo-yilia,if I not update the blog,you can see the problem in my site https://www.yansheng.xyz/

yansheng836 avatar Nov 05 '19 05:11 yansheng836

Found

I already know what the problem is:When i config like the example:·listMaxHeight: 90, The generated code looks like this:

<div class="aplayer-list" style="max-height: 90">
    <ol style="max-height: 90">

But when i see someone which it will work, is like this:

<div class="aplayer-list" style="max-height: 250px">
    <ol style="max-height: 250px">

It problem is px.

Trying

When I try to use this config : listMaxHeight: 90px, .The browser will report an error:

image

When I search the keyword listMaxHeight in CDN file

The keyword appears in three clusters and two similar ones.

  1. (3)Concatenate strings to html,but don't contain px: image

  2. As you can see, there is a default value 250px image

Please focus on the px: image

Conclusion

Draw a conclusion,this a :bug:.

yansheng836 avatar Nov 08 '19 14:11 yansheng836

First of all, thanks to yansheng836 for the discovery. In the official documentation, this is indeed a bug. Just change that number to a string form of number + px when configuring. Like this: listMaxHeight: '500px' Use this to make it work for now until the bug is officially fixed. It really does work.

jack10082009 avatar Oct 20 '22 13:10 jack10082009

Note that the number in the configuration is not the number of rows in the list, but the px value.

jack10082009 avatar Oct 20 '22 13:10 jack10082009

Note that the number in the configuration is not the number of rows in the list, but the px value.

Thank you very much for your answer 🌹

yansheng836 avatar Nov 08 '22 15:11 yansheng836