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

Table cells are always inputs #39

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

ignaciosy
Copy link
Collaborator

@ignaciosy ignaciosy commented Jan 15, 2025

Related to #15

There is no more hidding/showing text and inputs. Form inputs are now always shown and are styled to fit the table properly.

Screen.Recording.2025-01-15.at.16.37.04.mov

@ignaciosy ignaciosy self-assigned this Jan 15, 2025
@ignaciosy ignaciosy requested a review from a team as a code owner January 15, 2025 19:38
Copy link
Member

@simon-isler simon-isler left a comment

Choose a reason for hiding this comment

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

I'm not sure about this change. The readonly-attribute div was intended to be used for readonly attributes, that should not be displayed with a form input. #23 is related to this

@ignaciosy
Copy link
Collaborator Author

I'm not sure about this change. The readonly-attribute div was intended to be used for readonly attributes, that should not be displayed with a form input. #23 is related to this

Non-editable attributes are a separate feature, not implemented yet, and those will not be inputs of course. The point here is to avoid swapping between text blocks and inputs, which makes the screen flicker and other styling differences. This also makes it natively available to tab through the cells because the user can now tab through all inputs.

For read-only attributes I imagine table-cells to be conditionally rendered like:

<td>
    <% if attribute.editable? %>
        <%= render "editable_attribute", model: @model, record: record, attribute: attribute %>
    <% else %>
        <span><%= attribute %></span>
    <% end %>
</td>

@ignaciosy ignaciosy mentioned this pull request Jan 20, 2025
@ignaciosy ignaciosy changed the base branch from main to fix-ci-ruby-version January 20, 2025 09:41
@ignaciosy ignaciosy force-pushed the feature/table-cells-are-always-inputs branch from b75facb to 640654e Compare January 20, 2025 09:43
@ignaciosy ignaciosy requested a review from a team January 22, 2025 13:36
@simon-isler simon-isler self-requested a review January 23, 2025 07:59
@simon-isler
Copy link
Member

simon-isler commented Jan 24, 2025

We intended the readonly-attribute exactly for this feature. I wouldn't remove it now

Disregard, let's go with this simplified version for now and see 👍🏼

@simon-isler simon-isler removed request for a team and simon-isler January 24, 2025 13:53
Base automatically changed from fix-ci-ruby-version to main February 1, 2025 09:57
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.

2 participants