Exposing default options
See original GitHub issueFeature request is related to
The Embla Carousel core (all versions)
Describe the solution you’d like
Hi David (@davidcetinkaya),
Love seeing all the traction Embla Carousel is getting! One thing I’ve found myself doing frequently is creating a default options object on Embla for use with different carousel instances. For example:
entry or initialization file
import Embla from 'embla-carousel';
Embla.defaults = {
loop: true,
draggableClass: 'cursor-grab',
draggingClass: 'cursor-grabbing',
};
component file
const carousel = Embla(node, {
...Embla.defaults,
loop: false
});
Additional context
Idea initially came from an undocumented Flickity feature. How do you feel about adding something like this? Would be happy to PR if you’d like (though haven’t looked at the codebase in a long time 😆)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Exposing Cluster Options - Dask Gateway
The default handler returns the provided options unchanged. Available options are backend specific. For example, if running on Kubernetes, an options handler ...
Read more >Exposing the registry | OpenShift Container Platform 4.9
You can expose the route by using DefaultRoute parameter in the configs.imageregistry.operator.openshift.io resource or by using custom routes. --tls-verify= ...
Read more >How to set the default value of an exposed filter rather than -Any
This solution is working on Drupal >= 8 function YOURMODULE_form_alter(&$form, FormStateInterface $form_state, $form_id) { if ($form['#id'] ...
Read more >Change views exposed filter default option | Drupal.org
Hi I am looking at changing the default option of a exposed views filter. I found the below code which does the job...
Read more >How to change the default value (-Any-) of an exposed filter in ...
I have a horrible answer to this. I changed line 402 in sites/all/modules/hierarchical_select/hs_taxonomy_views.module from:
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@davidcetinkaya awesome! Thanks for all your continued work on improving Embla while keeping it lightweight and flexible etc 😀
Side note - your commitment to answering questions and helping others make the most out of Embla doesn’t go unnoticed. Happy to help in any way I can (I definitely need to spend more time familiarizing myself with the underlying engine!).
Cheers!
Hi @nikrowell,
This feature has been released with v.6.2.0 🎉. Please read more about it in the docs:
Give it a try if you want.
Best, David