Skip to content

Remove selected styling from item when ItemView is closed #117

Closed
wrigh393 opened this issue Nov 4, 2020 · 2 comments
Closed

Remove selected styling from item when ItemView is closed #117

wrigh393 opened this issue Nov 4, 2020 · 2 comments
Assignees
Labels
bug An issue that results in webqueue2 breaking

Comments

@wrigh393
Copy link
Collaborator

wrigh393 commented Nov 4, 2020

What Happened

Currently when an ItemView is closed the item that was selected keeps its styling.

ItemTable after an item has been selected and then the ItemView closed:
image

Expected Behavior

When an ItemView is closed the selected styling of an item should be removed

Steps to Reproduce

1.Open an item in ItemTable
2.Close the ItemView using the ItemViewAppBar
3.See that the item selected still has selected row styling

Logs

N/A

@wrigh393 wrigh393 added the bug An issue that results in webqueue2 breaking label Nov 4, 2020
@wrigh393 wrigh393 self-assigned this Nov 6, 2020
@campb303 campb303 added this to the v1 milestone Nov 6, 2020
@campb303
Copy link
Collaborator

campb303 commented Nov 6, 2020

This logic can be tied to the sidebarOpen state variable in App.js

https://github.itap.purdue.edu/ECN/webqueue2/blob/887fc63d44b4360d95ba71da24e57c803dbad13f/src/App.js#L15

@wrigh393
Copy link
Collaborator Author

wrigh393 commented Nov 25, 2020

This issue was fixed by creating the rowCanBeSelected prop along with the isSelected created to solve #74. The rowCanBeSelected prop is used in conjunction with isSelected in a ternary operation that is true only if the value of both are true. rowCanBeSelected's value is then set in the App.js file based on the state variable sidebarOpen. This variable's state is changed to true when an item is selected and false when it is closed which allows us to use it to also determine a rows styling based on if an item is open.

Sign in to join this conversation on GitHub.
Labels
bug An issue that results in webqueue2 breaking
Projects
None yet
Development

No branches or pull requests

2 participants