Comments (6)
@alexwizp Can we use the EuiAccordion - interactive content in trigger guidance to make the outer container a DIV, keep the arrow button, and have the link as a sibling element? We need to retain the arrow button as a visual cue and keyboard hook, and making the wrapper a DIV should remove the issue.
Holler at me if this is not workable or I'm missing context. Thank you!
from eui.
Is my question still the same: do we have any technical reason for that condition in the EUI code, or can we remove it?
The reason for that condition is an accessibility/cognition one. Even if not a technical reason, it's still valid and shouldn't be removed as a default.
Now, I will try setting buttonElement="div" according to the guide you provided. In this case, the button is displayed outside the panel, which does not align with the initial design.
This is solvable by not using an EuiPanel
but instead adding some custom CSS to the .euiAccordion__triggerWrapper
DOM element/wrapper, e.g.:
import { EuiAccordion, euiShadow } from '@elastic/eui';
<EuiAccordion
buttonElement="div"
css={(euiThemeContext) => css`
.euiAccordion__triggerWrapper {
${euiShadow(euiThemeContext, 'm')}
border-radius: ${euiThemeContext.euiTheme.border.radius.medium};
padding: ${euiThemeContext.euiTheme.size.base};
}
`}
// ... other props
>
...
</EuiAccordion>
While custom CSS is not ideal, in this case it should solve the accessibility issue for now while maintaining the existing design. For a longer term solution, EUI could consider a couple options:
- Updating the
triggerWrapper
element to allow custom props to be passed to it - Adding a custom prop/config, e.g.
buttonProps: { hasShadow: true }
that automatically adds a panel with shadows and/or allows consumers to configure a shadow on the button/trigger only
from eui.
@cee-chen @1Copenut
In our current design, the buttonContent
property for EuiAccordion
uses EuiPanel
, inside of which there is a trigger arrow EuiButtonIcon
. From a design perspective, the button is located inside the panel!
Now, I will try setting buttonElement="div"
according to the guide you provided. In this case, the button is displayed outside the panel, which does not align with the initial design.
See:
after:
Here I removed our EuiButtonIcon trigger button
Is my question still the same: do we have any technical reason for that condition in the EUI code, or can we remove it?
from eui.
Looking at the description it seems the nesting order needs refactored. @cee-chen stop me if I'm wrong, but wouldn't it make more sense to:
EuiPanel
as the outer containerEuiAccordion
as a DIV inside the panel- Button, link, and metadata as sibling inline elements in the accordion
from eui.
@1Copenut I would like to focus only on the EuiAccordion
component. From the component's API perspective, we have the ability to place any ReactNode
in the buttonContent
property. The question is: can we use arrowDisplay === "none"
in the case where buttonElement
is set to div
or not?
If you confirm that this case is not supported, I think I can recommend team to move the arrow button from the EuiPanel
, like this:
from eui.
👋 This issue hasn't seen activity in 3 days, so we're automatically closing this issue as answered. Please leave a comment if that's not the case, or if you have any remaining questions or issues.
from eui.
Related Issues (20)
- [EuiBadge][COLOR CONTRAST]: It is difficult to see selected text when I click and drag or select all with the keyboard HOT 2
- [EuiIcon] Icon asset paths/content off center from viewbox HOT 8
- [EuiSuperDatePicker] Allow setting absolute dates without Enter key HOT 1
- [New docs] Implement basic design changes to match the custom theme
- [EuiTooltip][KEYBOARD]: Would we consider adding `ESC` keypress to dismiss the tooltip?
- [EuiRange] Ticks not displaying correctly in React Strict Mode HOT 2
- [EuiSelectable] Screen reader arrow navigation experience is broken on Safari+VO HOT 1
- [Meta] [New docs] Full-text search
- [Meta] [New docs] Publish Elastic Design System patterns
- [EuiInputPopover] Removed setTimeout causes flaky test behavior HOT 1
- [EuiDualRange] Upper value isn't allowed to be blank HOT 3
- [EuiPageTemplate] Account for new serverless header style HOT 5
- [EuiDataGrid] Grid grows to infinite height in flex container if `height` not provided
- [EuiFlex] Add missing props to `EuiFlexGroup` and `EuiFlexItem`
- [Meta] Support React Strict Mode
- EuiPortal should be able to use different portal target than document.body based on provided Context HOT 7
- [EuiDataGrid] Cell text content visible below truncation when using `fontSize: "s"`
- FlexItem does not accept HTMLAttributes like title anymore
- EuiSteps unordered variant HOT 1
- [EuiSelectableTemplateSitewide] Allow default a link behavior for results
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eui.