magento2-page-builder
magento2-page-builder copied to clipboard
Bug fixed when using the decimal number in slidesToShow.
Description (*)
Slick slider unofficially enables the use of decimal point in the slidesToShow attribute. When we define the 5.2 to the slidesToShow attribute, slick slider will show the 5 items and the 20 percent of 6 item. But we need to use undecimal number in the slidesToScroll parameter. Otherwise, the slider will miscalculate. This pull request aims to solve this problem.

Manual testing scenarios (*)
- Set the default slidesToShow variable 4.5 in the view.xml (https://developer.adobe.com/commerce/frontend-core/page-builder/viewports/use-breakpoints/)
- See the products slider will show the 4 product items and half of 5 product item.
- Make sure it looks right when the slider moves to the next element.
Checklist
- [x] Pull request has a meaningful description of its purpose
- [x] All commits are accompanied by meaningful commit messages
- [ ] All new or changed code is covered with unit/integration tests (if applicable)
- [ ] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- [ ] All automated tests passed successfully (all builds are green)
@magento run all tests
@magento run Functional Tests B2B
@magento run all tests
@magento run Functional Tests B2B, Integration Tests, Performance Acceptance Tests, Static Tests, Unit Tests
@magento run Functional Tests B2B
:heavy_check_mark: QA Passed
Preconditions:
Implement Slick slider with Magento and enable PageBuilder
Manual testing scenario:
- Set the default slidesToShow variable 4.5 in the view.xml (https://developer.adobe.com/commerce/frontend-core/page-builder/viewports/use-breakpoints/)
- See the products slider will show the 4 product items and half of 5 product item.
- Make sure it looks right when the slider moves to the next element.
Actual Result: :heavy_check_mark: The slider should accept and show the allowed number of images in the slider.
After: :heavy_check_mark:
According to changes in this PR, this will accept only integer values not decimal values.
Before: :heavy_multiplication_x: The slick slider unofficially enables decimal points in the slidesToShow attribute. When we define the 5.2 to the slidesToShow attribute, the slick slider will show 5 items and 20 percent of 6 items. But we need to use undecimal numbers in the slidesToScroll parameter. Otherwise, the slider will miscalculate. This pull request aims to solve this problem.
The Failed B2B test is flaky, past 2 consecutive runs, the build failures are different:
Hence moving to merge in progress.
Thanks