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 Select-based setting breaking admin pages #2970

Merged
merged 5 commits into from
Jul 26, 2021
Merged

Conversation

davwheat
Copy link
Member

Fixes bug caused by #2959

Changes proposed in this pull request:

Prevents some attrs being passed to the <Select> component when they should not be.

For example, type: "select" creates a Select component, but this type attr was also passed to the component, resulting in Mithril attempting to perform weird changes on elements which are then disallowed by the DOM engine, causing the page to error.

Reviewers should focus on:

Are there other areas broken by the Select change? Extension setting pages seem to be fine when using these changes.

Screenshot

image

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).

@davwheat davwheat requested a review from SychO9 July 20, 2021 20:15
@davwheat davwheat self-assigned this Jul 20, 2021
@davwheat davwheat added this to the 1.0.5 milestone Jul 20, 2021
Copy link
Member

@SychO9 SychO9 left a comment

Choose a reason for hiding this comment

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

Looks good, though there is still another issue with the Select component changes, the select in Mail page for example is lacking the default className,

flarum lan_admin (27)

This is the relevant code, it seems like the provided additional className overrides the default one, while before the changes to Select component, it ignored it, idk why that class is provided, it doesn't make sense to have there, I'd remove it entirely (from both inputs).

https://github.com/flarum/core/blob/4bcfc5078c37e1adc9c9b62ce9791f0733de515c/js/src/admin/components/MailPage.js#L60-L66

@SychO9 SychO9 force-pushed the dw/fix-admin-errors branch from da80923 to f5b3e73 Compare July 21, 2021 11:22
@SychO9 SychO9 requested a review from tankerkiller125 July 24, 2021 17:47
@luceos luceos merged commit 81e6b17 into master Jul 26, 2021
@luceos luceos deleted the dw/fix-admin-errors branch July 26, 2021 11:03
@SychO9 SychO9 removed this from the 1.0.5 milestone Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants