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

React Pages Hierarchy SPFx - changing the style of button styles #5207

Closed
thosjo95 opened this issue Aug 15, 2024 · 4 comments
Closed

React Pages Hierarchy SPFx - changing the style of button styles #5207

thosjo95 opened this issue Aug 15, 2024 · 4 comments

Comments

@thosjo95
Copy link

thosjo95 commented Aug 15, 2024

Disclaimer

Yes

Sample

https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-pages-hierarchy

Question

I want to modify the styling of buttons in the "children pages" layout to allow the text to wrap and remove the ellipsis (...) that appears when the text is too long. The goal is to ensure that text is fully visible, and the container expands dynamically to accommodate it.

I'm doing this by eiditing this ybder the the "Layouts.module.scss" under webparts>pagehierarchy>components>Layout

.listLayoutItemButton {
    @include ms-font-m-plus;
    @include ms-fontWeight-regular;
    display: block;

    :global .ms-Button-textContainer {
      width: calc(100% - 10px);
    }

    :global .ms-Button-label {
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 18px;
    }
};

Error Logs: The build fails with warnings related to linting and TypeScript, but no errors that directly point to the CSS change. Warnings include @typescript-eslint/no-explicit-any, no-unused-vars, and other TypeScript linting issues.

Reversion: Reverting the text-align property back to left resolves the build issues, and the web part works as expected.
Browser Console: After changing the alignment to right, the browser console does not show any additional meaningful errors when inspecting the running web part.

image

Reverting the changes and reuploading fixes the app again.

Current Setup:
Node.js version: v16.20.2
SPFx build tools version: 3.18.1
React version: 16.9.0
TypeScript version: 4.7.4

Are there any additional debugging steps or configurations I should try to diagnose why a simple CSS change would result in build issues?

Any guidance or suggestions would be greatly appreciated!

@thosjo95
Copy link
Author

image

Here's the design change I want btw. I dont want these ..., but rather a wrap of the text that dynamically makes the button bigger.

@AriGunawan
Copy link
Contributor

I can update the CSS without any issues, so I'm unable to replicate the problem.
Do you have a public branch with the changes available for testing?

Copy link

This issue has been marked as stale due to no progress in over 90 days. If you are still experiencing this issue, please provide additional information so we can help you resolve it.

Copy link

github-actions bot commented Dec 7, 2024

Closing this issue due to lack of activity. If you are still encountering this issue, please do not hesitate to open a new issue. Make sure to follow the guidance on how to create good issues to increase your chances of getting the help you deserve.

@github-actions github-actions bot closed this as completed Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants