Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List view shows each map twice #2351

Closed
TomGoBravo opened this issue Apr 23, 2023 · 1 comment · Fixed by #2468
Closed

List view shows each map twice #2351

TomGoBravo opened this issue Apr 23, 2023 · 1 comment · Fixed by #2468

Comments

@TomGoBravo
Copy link
Contributor

TomGoBravo commented Apr 23, 2023

Each time applyGlobalStyles is called a map div is appended to the DOM after the textarea. I added logging in processLeafletWidget and see that there are two calls:

In form.js:

    // Apply global styles for current page after page loaded
    $(function() {
        faForm.applyGlobalStyles(document);
    });

and bs4_modal.js

$(function() {
  // Apply flask-admin form styles after the modal is loaded
  window.faForm.applyGlobalStyles(document);
});

I don't know if both calls to applyGlobalStyles are needed. A hack fix is exiting processLeafletWidget if the textarea is already hidden.

@TomGoBravo
Copy link
Contributor Author

@mrjoes : please take a look at my proposed fix (or workaround?) #2354

TomGoBravo added a commit to TomGoBravo/tourist-with-flask that referenced this issue Aug 29, 2023
Update flask-admin to a branch that is only one commit away from the public head. The extra commit is needed as a work-around for pallets-eco/flask-admin#2351

The update fixes
```
tourist/tests/test_basic.py::test_heavy
  /home/thecap/.pyenv/versions/tourist-3.10.7/lib/python3.10/site-packages/flask_admin/form/widgets.py:2: DeprecationWarning: '_request_ctx_stack' is deprecated and will be removed in Flask 2.4.
    from flask.globals import _request_ctx_stack
```
thanks to pallets-eco/flask-admin#2286.
@samuelhwilliams samuelhwilliams self-assigned this Jul 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

2 participants