- Issue created by @kerrymick
- Assigned to nk_
- Status changed to Needs work
7 months ago 7:14am 15 May 2024 - π³π±Netherlands nk_
That make sense indeed. I am currently busy with a new release, with CKEditor5 included, once I am there I will do my best to include this option as well. In the meantime any patches welcome. Additional code would require schema update, default settings and the Swiper entity form changes at least.
- Status changed to Needs review
5 months ago 4:46pm 15 July 2024 - π¨π¦Canada czunigaco
Hello,
This patch allows for float values to be saved in the slidesPerView setting.
It updates the schema. It sets the step value on the number form element is set to 0.5. The elementsHandler method grabs the data type as defined on the config schema and uses that to determine to cast the form value to an int or a float. Lastly, there's a hook_update that updates the current sliders and default configs.
- πΊπΈUnited States kerrymick Chicago
I tested this patch and it worked really well. Thanks @czunigaco!
- π¨π¦Canada czunigaco
I've updated the version to 2.0.x-dev and added a new patch with a slight change to better handle the number type. Now, it's only processed if the value is not empty.
Interdiff attached.
- Status changed to RTBC
3 months ago 11:04am 15 September 2024 - πΊπΈUnited States thejimbirch Cape Cod, Massachusetts
+1 for RTBC. We are using this patch on multiple projects now.
- First commit to issue fork.
- @bbu23 opened merge request.
- π·π΄Romania bbu23
Hi,
Thank you for your contributions.
I applied the patch #5 in Drupal 10.2 and 11(latest) and ran the update. I also added the patch to an MR for easier review.
I then edited the default swiper in both sites and increased the previous value (which was 2) to 2.5. Upon saving, all slides values were lost and no matter what I add, the fields are empty. When exporting the Swiper, the values have null:slidesPerView: null spaceBetween: '0' slidesPerGroup: null loopedSlides: null
As a side note, the number of the update hook should be changed. Please see https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension...
- π«π·France kumkum29
Hello,
With this patch #5, the option '#step' => '0.5' is too restrictive.
For more granularity and flexibility we need to be able to use different options per swiper/breakpoints. The '#step' => '0.1' option would be more useful.Is it possible to change this option in a next patch / dev version ?
- b0ecc3c4 committed on 2.0.x
Issue #3446884 by czunigaco: Possible to allow for decimals
- b0ecc3c4 committed on 2.0.x
- π³π±Netherlands nk_
Pushed into 2.0.x-dev and ready for testing. Thanks!
- π³π±Netherlands nk_
@kumkum29 the change would be an easy one unless I am missing something. Does the other folks agree? I am thinking to leave the current dev version that is including it for the next 7-10 days like so testing everything and voting welcome!
- π·π΄Romania bbu23
Fixed the update hook number as per naming conventions.
- π·π΄Romania bbu23
As per @kumkum29 and @nk_ and no other objections, I've reduced the step form 0.5 to 0.1
- Assigned to bbu23
- Status changed to Fixed
13 days ago 2:38pm 10 December 2024