Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(TextLink): make text content selectable by user #930

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions src/accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ export const AccordionItem = React.forwardRef<TouchableElement, AccordionItemCon

type AccordionBaseProps = {
children: React.ReactNode;
/**
* @deprecated This field is deprecated and it has no effect.
*/
noLastDivider?: boolean;
dataAttributes?: DataAttributes;
onChange?: (index: number, value: boolean) => void;
Expand All @@ -226,7 +229,6 @@ type AccordionProps = AccordionBaseProps & ExclusifyUnion<SingleOpenProps | Mult
export const Accordion: React.FC<AccordionProps> = ({
children,
dataAttributes,
noLastDivider,
index,
defaultIndex,
onChange,
Expand All @@ -239,7 +241,6 @@ export const Accordion: React.FC<AccordionProps> = ({
singleOpen,
});
const lastIndex = React.Children.count(children) - 1;
const showLastDivider = !noLastDivider;

return (
<AccordionContext.Provider value={{index: indexList, toogle}}>
Expand All @@ -249,7 +250,7 @@ export const Accordion: React.FC<AccordionProps> = ({
.map((child, index) => (
<React.Fragment key={index}>
{child}
{(index < lastIndex || showLastDivider) && (
{index < lastIndex && (
<Box paddingX={16}>
<Divider />
</Box>
Expand Down
14 changes: 5 additions & 9 deletions src/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -578,19 +578,15 @@ type RowListProps = {
children: React.ReactNode;
ariaLabelledby?: string;
role?: string;
/**
* @deprecated This field is deprecated and it has no effect.
*/
noLastDivider?: boolean;
dataAttributes?: DataAttributes;
};

export const RowList: React.FC<RowListProps> = ({
children,
ariaLabelledby,
role,
dataAttributes,
noLastDivider,
}) => {
export const RowList: React.FC<RowListProps> = ({children, ariaLabelledby, role, dataAttributes}) => {
const lastIndex = React.Children.count(children) - 1;
const showLastDivider = !noLastDivider;
return (
<div
role={role}
Expand All @@ -602,7 +598,7 @@ export const RowList: React.FC<RowListProps> = ({
.map((child, index) => (
<React.Fragment key={index}>
{child}
{(index < lastIndex || showLastDivider) && (
{index < lastIndex && (
<Box paddingX={16}>
<Divider />
</Box>
Expand Down
1 change: 1 addition & 0 deletions src/text-link.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const base = style([
cursor: 'pointer',
}),
{
userSelect: 'text',
lineHeight: 'inherit',
wordBreak: 'break-word',
'@media': {
Expand Down