-
Notifications
You must be signed in to change notification settings - Fork 78
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
Wrong calculation of breakpoints #2917
Comments
Important is the width of the panel and not of the screen. We use JsonConfig in Dialogs too and in this case it is important to know the width of the dialog window. |
for example i set a 3 column table with md = 6 if no widths are defined everything is ok, for eaxample see adapter openliga in version 1.8.0 (in v1.8.1 i enlarged the with as a workaround) |
Hm… but if the dev defined a smaller width then this width is the relevant one for the question how to display the table and their elements inside this element. Right? Or what do I miss? |
I think @GermanBluefox approach makes perfect sense. Problems often arise, especially with displays in dialogs. The current solution solves all problems, including tabs in popups such as in the Matter Adapter. |
mui react defines breakpoints in terms of the screen width of a device/browser. as an example: the openligadb table is defined at md with 6. the screen width is md. however, the calculation from bluefox results in sx. this would mean that a user has to specify the usecardfor setting at md with sx my original calculation and assumption is that the calculation results in the actual screen width, then compares it with the specification with usecardfor and applies it accordingly. if the dev then provides a specification for the breakpoint, you are actually flexible, as the following construct also works. screen width is md, md is 4 and usecardfor is also on md, then you are able to use the card view even with wider screens. I don't really understand the advantages of dialogs, tabs, etc., since this discussion is only about configTable, or have I not understood something? i add a link the the bluefox function to clarify the relation to the code |
Was für eine Rolle spielt die Breite von Display (Browserfenster) wenn ich meine Tabelle in einem schmalen Fenster zeige?? Ich verstehe die Logik nicht. |
Grundsätzlich so wie du es sagst ist es schon richtig. Die ursprüngliche herangehensweise war, das Tabellenproblem für kleine/schmale Displays zu optimieren, Durch die Berechnung der Elementbreite in deiner Funktion haben wir nun ein Bruch der Logik, da du nun die breakpoints-Notationm (wie gesagt bezieht die sich auf Gerätegreite) mit Elementbreite gleich setzt. Das könnte meiner Meinung nach die Devs verwirren. Wenn wir bei der Verwendung von Elementbreite bleiben, sollte man sich da etwas anderes überlegen. Aber wir können es ja mal laufen lassen und sehen ob hier fragen aufkommen. Evtl vermute ich hier zu viel. |
ioBroker.admin/packages/jsonConfig/src/JsonConfigComponent/ConfigTable.tsx
Line 1555 in c854d42
https://github.com/oweitman/ioBroker.admin/blob/79bfa9e5b08535770bfdabc1fb7902de2eadde6c/packages/jsonConfig/src/JsonConfigComponent/ConfigTable.tsx#L1097
this.state.width is the width of the actual element and not the width of the screen.
the original proposed function
is taken from a hook of the next mui react version 6
https://mui.com/material-ui/react-use-media-query/
https://github.com/mui/material-ui/blob/44ba5f75ed60074892ef135fa6283a28af93a74c/packages/mui-system/src/useMediaQuery/useMediaQuery.ts
The text was updated successfully, but these errors were encountered: