mirror of
https://github.com/strapi/strapi.git
synced 2026-01-06 12:13:52 +00:00
Fix left menu link active and dnd bug when draging with the img tag
This commit is contained in:
parent
56b93581d8
commit
69488c5d98
@ -17,7 +17,10 @@ import styles from './styles.scss';
|
||||
function LeftMenuLink(props) {
|
||||
const isLinkActive = startsWith(
|
||||
props.location.pathname.replace('/admin', '').concat('/'),
|
||||
props.destination.replace(props.pluginSuffixUrl, '').concat('/')
|
||||
|
||||
props.destination
|
||||
.replace(props.suffixUrlToReplaceForLeftMenuHighlight, '')
|
||||
.concat('/')
|
||||
);
|
||||
|
||||
const plugin =
|
||||
@ -87,11 +90,13 @@ LeftMenuLink.propTypes = {
|
||||
}).isRequired,
|
||||
pluginSuffixUrl: PropTypes.string,
|
||||
source: PropTypes.string,
|
||||
suffixUrlToReplaceForLeftMenuHighlight: PropTypes.string,
|
||||
};
|
||||
|
||||
LeftMenuLink.defaultProps = {
|
||||
pluginSuffixUrl: '',
|
||||
source: '',
|
||||
suffixUrlToReplaceForLeftMenuHighlight: '',
|
||||
};
|
||||
|
||||
export default LeftMenuLink;
|
||||
|
||||
@ -81,6 +81,9 @@ function LeftMenuLinkContainer({ plugins, ...rest }) {
|
||||
label={get(plugin, 'name')}
|
||||
destination={destination}
|
||||
pluginSuffixUrl={pluginSuffixUrl}
|
||||
suffixUrlToReplaceForLeftMenuHighlight={
|
||||
plugin.suffixUrlToReplaceForLeftMenuHighlight || ''
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@ -66,6 +66,15 @@ const NameWrapper = styled.div`
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
img {
|
||||
user-drag: none;
|
||||
user-select: none;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-drag: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
}
|
||||
|
||||
${({ isHidden }) => {
|
||||
if (!isHidden) {
|
||||
return css`
|
||||
|
||||
@ -29,6 +29,7 @@ const plugin = {
|
||||
name: pluginPkg.strapi.name,
|
||||
preventComponentRendering: false,
|
||||
suffixUrl: () => '/ctm-configurations/models',
|
||||
suffixUrlToReplaceForLeftMenuHighlight: '/models',
|
||||
trads,
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user