Aleksi44 / wagtailsvg

Wagtail + SVG
https://pypi.org/project/wagtailsvg/
GNU General Public License v3.0
35 stars 24 forks source link

The image in preview doesn't change in Mozilla Firefox #2

Closed mentecuantica closed 3 years ago

mentecuantica commented 3 years ago

When you choose an image with SvgImageChooser, it doesn't change the image in preview. Browser Firefox 83.0, OS - MX Linux

mentecuantica commented 3 years ago

it's only shows empty block

<div id="body-1-value-columns-0-value-imagesvg-chooser" class="chooser image-chooser" data-choose-modal-url="/admin/svg-chooser/">

    <div class="chosen">

            <div class="preview-image">

                    <img alt="">

            </div>

        <ul class="actions">

                <li>
                    <button type="button" class="button action-clear button-small button-secondary">Clear choice</button>
                </li>

            <li>
                <button type="button" class="button action-choose button-small button-secondary">Choose another SVG item</button>
            </li>

        </ul>
    </div>

    <div class="unchosen">
        <button type="button" class="button action-choose button-small button-secondary">Choose a SVG item</button>
    </div>

</div>
mentecuantica commented 3 years ago

In Google Chrome the behavior is slightly different, when you select another svg item, it shows the same image. If you clear choice, and then select svg item, it would show you the previous image.

In few words: it works correctly after saving and reloading the page - shows the image you've actually choosed

Aleksi44 commented 3 years ago

Yeah, I have the same problem :/ I am on it, I come back to you during the day with a fix (I hope).

Aleksi44 commented 3 years ago

Just fix on https://github.com/Aleksi44/wagtailsvg/pull/3

You can test this release with pip install wagtailsvg==0.0.9

After, can you tell me if you still have the bug?

mentecuantica commented 3 years ago

Still in the firefox and chrome the same behavior

<div class="chosen">

            <div class="preview-image">

                    <img style="width: 100%" class="preview-url" alt="">

            </div>

        <ul class="actions">

                <li>
                    <button type="button" class="button action-clear button-small button-secondary">Clear choice</button>
                </li>

            <li>
                <button type="button" class="button action-choose button-small button-secondary">Choose another SVG item</button>
            </li>

        </ul>
    </div>
Aleksi44 commented 3 years ago

Now I think it's OK with https://github.com/Aleksi44/wagtailsvg/commit/1f7497c1389dca27960968ce495a21fee85c0eff You can test this release with pip install wagtailsvg==0.0.10 Can you tell me if it's OK ?

mentecuantica commented 3 years ago

i've made a fork of a version 0.0.9, seems on the test server to be working ))