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

Increment field id in the print area #295

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ofostier
Copy link
Contributor

@ofostier ofostier commented Jun 7, 2024

With this Fix we can now print more than 1000 card without error & lags

@@ -102,7 +102,7 @@ export const WifiCard = (props) => {

<Pane width={'100%'}>
<TextareaField
id="ssid"
id={'ssid' + (props.keyid === undefined ? '' : props.keyid)}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do this logic once outside of the return and then reuse it everywhere, maybe something like:

const keyid = props.keyid || '';
const suffixKeyID = (prefix) => `${prefix}-${keyid}`

...

return (
  <textarea>
    id={suffixKeyID('ssid')}
     ...
  </textarea>
  <otherthing>
     id={suffixKeyID('eapmethod')}
     ...
  </otherthing>
)

@ofostier
Copy link
Contributor Author

Changes made.
Better logic but maybe a lack performance with more than 400 cards to print

@ofostier ofostier requested a review from bndw June 13, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants