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

Some widgets unsupported #2

Closed
pythonbrad opened this issue Dec 13, 2022 · 4 comments
Closed

Some widgets unsupported #2

pythonbrad opened this issue Dec 13, 2022 · 4 comments

Comments

@pythonbrad
Copy link
Contributor

pythonbrad commented Dec 13, 2022

Some widgets are not styled.

  • django.forms.widgets.DateInput
  • django.forms.widgets.DateTimeInput
  • django.forms.widgets.NumberInput
  • django.forms.widgets.TextInput
  • django.forms.widgets.ClearableFileInput
  • django.forms.widgets.SplitDateTimeWidget
  • django.forms.widgets.TimeInput
  • django.forms.widgets.URLInput

Some widgets are not styled properly

  • crispy_bulma.widgets.FileUploadInput

System Configuration

  • Bulma 0.9.3
  • Django 4.1.4
  • crispy-bulma 0.8.0
  • django-crispy-forms 1.14.0

Update 2022-12-29:

  • ✔️ django.forms.widgets.DateInput
  • ✔️ django.forms.widgets.DateTimeInput
  • ✔️ django.forms.widgets.NumberInput
  • ✔️ django.forms.widgets.TextInput
  • ✅ django.forms.widgets.ClearableFileInput (explicit use of FileUploadInput widget for now)
  • ❎ django.forms.widgets.SplitDateTimeWidget (Fix SplitDateTimeField widget rendering #5 )
  • ✔️ django.forms.widgets.TimeInput
  • ✔️ django.forms.widgets.URLInput
  • ✔️ crispy_bulma.widgets.FileUploadInput
@ckrybus
Copy link
Owner

ckrybus commented Dec 13, 2022

Hi @pythonbrad,

I did not check all the widgets you listed, but they should work. Here is a small demo how a rendered form looks like.

I suspect that you did not include bulma.css in your base.html template. Here is an example:

<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
  </head>

@pythonbrad
Copy link
Contributor Author

Here is a small demo how a rendered form looks like.

I tried to update the demonstration to use the crispy_bulma.widgets.FileUploadInput widget.
Available Here

What is change ?

a

b

@pythonbrad
Copy link
Contributor Author

pythonbrad commented Dec 14, 2022

The following widgets can be fixed in using of widget=forms.TextInput(attrs={'type': '<type>'})

  • django.forms.widgets.DateInput
  • django.forms.widgets.DateTimeInput
  • django.forms.widgets.NumberInput
  • django.forms.widgets.TextInput
  • django.forms.widgets.TimeInput
  • django.forms.widgets.URLInput

Preview

NB: Just Date, Datetime, and Time is rendered using only the trick (TextInput).

  • Left: Before, Right: After
    a

@ckrybus
Copy link
Owner

ckrybus commented Dec 29, 2022

@pythonbrad all widgets except SplitDateTimeWidget (issue #5) should work now in the main branch.
For now FileField (ClearableFileInput, FileInput) is styled correctly only when the newly fixed FileUploadInput widget is being explicitely used.

@ckrybus ckrybus closed this as completed Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants