kolibri-design-system icon indicating copy to clipboard operation
kolibri-design-system copied to clipboard

Add "auto" value to KFixedGridItem/KGridItem's "alignment" prop

Open MisRob opened this issue 4 years ago • 3 comments

Product

Kolibri

Desired behavior

Allow 'auto' value in KFixedGridItem/KGridItem's alignment prop and when alignment is 'auto', do not set text-align (like it happens when alignment is 'right', 'center', 'left') but instead set dir=auto on the grid item element.

Current behavior

text-align is set on grid items all the time. Even when we set dir=auto on KFixedGridItem/KGridItem, it doesn't work properly because of conflicting with text-align defined in the grid item component, and we need to use a workaround like for example unsetting text-align here.

The Value Add

No hacks will be needed anymore to make automatic directionality work for content in grid items which means that chances that accessibility works as expected will be higher in regards to dir=auto.

Comments

Related Slack thread

MisRob avatar Oct 26 '21 14:10 MisRob

Hey! Can I work on this issue?

BabyElias avatar Mar 09 '24 02:03 BabyElias

Hi @BabyElias, yes, thank you

MisRob avatar Mar 12 '24 11:03 MisRob

Hey! Just to inform, I have started working on this issue but am caught up currently due to my semester examinations. I'll generate a PR as soon as possible, once my exams are over next week. Thank you for your time and patience :)

BabyElias avatar Apr 26 '24 13:04 BabyElias

hey @AlexVelezLl since there is no one assigned rn can i work on this issue?

lokesh-sagi125 avatar Oct 18 '24 11:10 lokesh-sagi125

Hey @lokesh-sagi125! For sure! I will assign this to you. Please feel free to ask any question if needed 🤗.

AlexVelezLl avatar Oct 18 '24 13:10 AlexVelezLl

hey @AlexVelezLl i went through the code for this issue and feel like the mention issue has already been dealt with, it is accepting the auto value from the common.js file, do you want me to add it directly to the file?

lokesh-sagi125 avatar Nov 04 '24 10:11 lokesh-sagi125

@lokesh-sagi125 I am not sure I can understand exactly what you mean. Are you saying that this:

when alignment is 'auto', do not set text-align (like it happens when alignment is 'right', 'center', 'left') but instead set dir=auto on the grid item element.

already works?

MisRob avatar Nov 08 '24 07:11 MisRob

yes @MisRob when i tested it in playground and inspected it , there was no text-align being set and the div is being set div=auto , i have attached an image of my console.Image

lokesh-sagi125 avatar Nov 08 '24 15:11 lokesh-sagi125

this was the acceptance criteria of the issue right?

lokesh-sagi125 avatar Nov 08 '24 15:11 lokesh-sagi125

Thanks for checking this @lokesh-sagi125. Yes, it seems it already works as expected. Let me confirm some time later this week and we can probably close the issue then.

MisRob avatar Nov 11 '24 10:11 MisRob

sure @MisRob

lokesh-sagi125 avatar Nov 11 '24 14:11 lokesh-sagi125

@lokesh-sagi125 I confirm this has been resolved already in https://github.com/learningequality/kolibri-design-system/commit/c85e4d80e0759c16e68fc5435ee8ee572ece0c5d so will close the issue. Thank you for checking on this, either it was done after I opened the issue and we didn't link, or I missed it.

MisRob avatar Nov 14 '24 10:11 MisRob

glad to know it was fixed:)

lokesh-sagi125 avatar Nov 14 '24 11:11 lokesh-sagi125