foundation / foundation/yeti

[Accordion] Javascript up and down methods not working

Open
#12,607 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
29.8k
Forks
5.4k
Avg merge
25m
Merged PRs (30d)
1

Description

## Expected Behavior
It should be possible to open an Accordion tap using the JavaScript 'down' method described in [the documentation](https://get.foundation/sites/docs/accordion.html#down)

## Current Behavior
The 'down' action seems to close the the target `element.foundation('down', elementToOpen);`
'up' seems to have no effect

## Test Case and/or Steps to Reproduce

Test Case: https://codepen.io/aderowbotham/pen/YzgKjjE?editors=1111

## Context

I am writing the accordion dynamically with javascript / jQuery then initialising it, this is because the data is read from an API response, and cannot be pre-rendered in the HTML page

This is possible related to https://github.com/foundation/foundation-sites/issues/12494 but not sure. However the codepen I have created may prove useful.

## Checklist

- [x] I have read and follow the CONTRIBUTING.md document.
- [x] This is a bug report or a feature request.
- [x] There are no other issues similar to this one.
- [x] The issue title and template are correctly filled.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the accordion behavior in the linked CodePen and compare it with the JavaScript “down” and “up” methods in the linked Accordion documentation. Review the related issue #12494 for context on dynamically initialized accordions. Done means both methods perform the documented open and close actions when the accordion is created from API data.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.