question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exposing default options

See original GitHub issue

Feature 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
nikrowellcommented, Feb 6, 2022

@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!

2reactions
davidjerlekecommented, Feb 6, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found