Giter Site home page Giter Site logo

Comments (15)

cellarosi avatar cellarosi commented on May 18, 2024

Sorry, was {{ form.as_p }}, not {{ table.as_p }}..

The error remain..

from django-autocomplete-light.

jpic avatar jpic commented on May 18, 2024

Humn, that's weird, on what documentation page do you see it ?

I thought all code in the documentation was directly taken from the working test project !

So your error is likely to be elsewhere ...

from django-autocomplete-light.

cellarosi avatar cellarosi commented on May 18, 2024

In non_admin app you use

<html>
<body>
    <form method="post" action="">
        {% csrf_token %}
        <table>
            {{ form.as_table }}
        </table>
        <input type="submit" />
    </form>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
    {% include 'autocomplete_light/static.html' %}
</body>

I made something like this but replacing {{ form.as_table }} with {{ form.as_p }} and that error occurred.. I didn't try on your demo yet.

from django-autocomplete-light.

jpic avatar jpic commented on May 18, 2024

Yes, doesn't it work for you ?

from django-autocomplete-light.

cellarosi avatar cellarosi commented on May 18, 2024

Yes, but if you replace {{ form.as_table }} with {{ form.as_p }}, that error occurred

from django-autocomplete-light.

jpic avatar jpic commented on May 18, 2024

Yess !!! thanks ! I can reproduce this issue. I'm on it panic not xD

from django-autocomplete-light.

cellarosi avatar cellarosi commented on May 18, 2024

;)

from django-autocomplete-light.

jpic avatar jpic commented on May 18, 2024

I can reproduce the problem with this simple html file:

<p>
    <span>hello
        <div>
        </div>
    </span>
</p>

Both Firefox and Chromium will intepret HTML as (according to element inspector):

<p>
    <span>hello
    </span>
</p>

<div>
</div>

I think this is because div is a block element and isn't allowed to be contained in a

... So Chromium/Firefox think that the HTML is broken and attempts to fix it. As a result, Firefox and Chromium messes with our HTML.

I fear like this is going to be complicated to fix .. any suggestion ?

from django-autocomplete-light.

cellarosi avatar cellarosi commented on May 18, 2024

Mmmm... Not really.... Firefox shouldn't think that this is a broken HTML.. Have you a way to do something from input id directly?

from django-autocomplete-light.

jpic avatar jpic commented on May 18, 2024

Yes but there's not only that ... inputs can also be added dynamically (ie. formsets) and everything currently depends on having a container ... I can try to hack away that requirement but:

  1. I can't do this right now, in an hour I can get started
  2. I'm not sure it's really going to work, at best i can replace divs by spans ... and I'm such an aweful web designer I might even need to get help for that ..

(If you're in a hurry, I can recommend that you use django-uni-form or django-crispy-forms to render your forms nicely ... I haven't used .as_p myself for years ...).

I'm sure that we need to support .as_p thought, at least to make our app solid against browser's messing around.

from django-autocomplete-light.

cellarosi avatar cellarosi commented on May 18, 2024

No no don't worry i can use as_table with no problem for now, i have only reported it..

from django-autocomplete-light.

jpic avatar jpic commented on May 18, 2024

Thanks for your feedback !

I think the best solution is to fix the widget template to only contain inline elements. If you have a little time and you are good at webdesign and you want to help ... feel free to issue a pull request :D

from django-autocomplete-light.

cellarosi avatar cellarosi commented on May 18, 2024

I'll use your app so i'll try tu fix it but i'm not a designer.. :)

from django-autocomplete-light.

jpic avatar jpic commented on May 18, 2024

If you want but else I'll just fix the HTML and ask a friend to do me a favor :D

Might take a few days to get it released thought.

I'm wondering about the release version number thought, if this will be considerable as a BC break.

from django-autocomplete-light.

jpic avatar jpic commented on May 18, 2024

Super-seeded by issue #51.

Thanks again for your feedback.

from django-autocomplete-light.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.